当我从iPhone Simulator(iOS 6)拨打电话时
var request = System.Net.HttpWebRequest.Create(url);
我有以下错误
An exception was thrown by the type initializer for System.Net.WebRequest
Error Initializing the configuration system.
Unrecognized configuration section <system.runtime.remoting>
/Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/etc/mono/2.0/machine.config
堆栈跟踪
at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in <filename unknown>:0
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0
at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0
at System.Net.WebRequest..cctor () [0x00000] in <filename unknown>:0
我不理解我必须做什么。
更新
我的项目有一个CORE,其中引用了以下库:
我的iOS项目链接CORE项目,并具有以下引用:
System.Configuration
不是Xamarin.iOS随附的BCL的一部分(既不是程序集也不不是名称空间)。
如果收到此错误,是因为(以某种方式)您将另一个System.dll
(Mono或MS的v2.0版本)带入了模拟器,因此无法正常工作。
确保仅引用Xamarin.iOS的BCL程序集,问题将消失。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句