Invalid IL code in System.Configuration.ConfigurationManager:get_AppSettings (): method body is empty.
When trying to retrieve an app setting from app.config. The key I am looking for is present in the file. Why is this happening?
Visual Studio Community 15 with Xamarin
Windows 10 Pro
<add key="key" value="value"
string key = ConfigurationManager.AppSettings["key"];
The steps to reproduce this are trivial. Enter the appSetting in the app.config and try to extract the value in the code. What is going on here? I get the same error if I try doing this.
Configuration config = ConfigurationManager.OpenExeConfiguration(path to file);
Are you sure you're using Xamarin.Android? Xamarin.Android does not provide System.Configuration.ConfigurationManager, and the only included types in the v1.0 framework directory -- e.g. mscorlib.dll, System.dll -- are:
Could you please attach a repro project?
I have the same error, see attach screen shot.
I think we are confuse by Visual Studio...
We are able to reference System.Configuration.dll in a droid project, with no error/warning until we run our project.
Created attachment 18427 [details]
Screen shoot error
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!
For a full list of assemblies that are supported in Xamarin.Android you can find documentation here:
Thus https://bugzilla.xamarin.com/show_bug.cgi?id=41240#c1 is saying that you cannot add this assembly to your project as it's not supported.