[MonoDevelop] Problem with configuration manager

david.chhang david.chhang at gmail.com
Fri May 20 05:32:49 EDT 2011


Hi,

I want to develop an Android application with Monodevelop, and i want to
access to a app.config file. So, I put the System.configuration.dll in the
references and add using System.Configuration. When I compile the program,
it works, but when the application launch, it doesn't work...

this is the code :

                                      base.OnCreate (bundle);
			
			var tv = new TextView(this);
			
			tv.Text = ConfigurationManager.AppSettings["utilisateur"];
			
			SetContentView(tv);

It is simple, just a test to know if the configuration manager works, and I
have this message in the console :

I/MonoDroid(  279): UNHANDLED EXCEPTION: System.TypeLoadException: Could not
load type 'System.Configuration.ConfigurationErrorsException' from assembly
'System.Configuration, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
I/MonoDroid(  279): at Test.Activity1.OnCreate (Android.OS.Bundle) <0x00047>
I/MonoDroid(  279): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_
(intptr,intptr,intptr) <0x0005f>
I/MonoDroid(  279): at (wrapper dynamic-method)
object.ff8541a0-fab1-4158-a6ca-70aef38b25a7 (intptr,intptr,intptr) <0x00033>
E/mono    (  279): 
E/mono    (  279): Unhandled Exception: System.TypeLoadException: Could not
load type 'System.Configuration.ConfigurationErrorsException' from assembly
'System.Configuration, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
E/mono    (  279):   at Test.Activity1.OnCreate (Android.OS.Bundle bundle)
[0x00000] in <filename unknown>:0 
E/mono    (  279):   at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_
(IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState)
[0x00000] in <filename unknown>:0 
E/mono    (  279):   at (wrapper dynamic-method)
object:ff8541a0-fab1-4158-a6ca-70aef38b25a7 (intptr,intptr,intptr)

I have Monodevelop 2.6 beta 2 on Windows 7.

I don't know what it means...somebody can help me please ?

Thanks

PS : I'am French and i don't speak English very well. Sorry. 

--
View this message in context: http://mono.1490590.n4.nabble.com/Problem-with-configuration-manager-tp3538051p3538051.html
Sent from the Mono - MonoDevelop IDE mailing list archive at Nabble.com.


More information about the Monodevelop-list mailing list