2

When i make that call from iPhone Simulator (iOS 6)

var request = System.Net.HttpWebRequest.Create(url);

I have following error

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

Stacktrace

  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 

I doesn't undestand what i must do..

UPDATE

My project have a CORE where are referenced that libraries:

  • Newtnsoft.Json.dll System.Net.dll (from /Library/Frameworks/Mono.framework/Libraries/mono/4.5/)
  • System.Core.dll (from /Library/Frameworks/Mono.framework/Libraries/mono/4.5/)
  • System.Core.dll (from /Library/Frameworks/Mono.framework/Libraries/mono/4.5/)
  • System.Data.Linq.dll (from /Library/Frameworks/Mono.framework/Libraries/mono/4.5/) System.dll (from /Library/Frameworks/Mono.framework/Libraries/mono/4.5/)
  • mscorlib.dll (from /Library/Frameworks/Mono.framework/Libraries/mono/4.5/) Cirrious.MvvmCross.dll (vnext version)

My iOS Project link CORE Project and have that references:

  • monotouch
  • Cirrious.MvvmCross.dll (vnext version)
  • Cirrious.MvvmCross.Binding.dll (vnext version)
  • Cirrious.MvvmCross.Binding.Touch.dll (vnext version)
  • Newtnsoft.Json.dll
  • Cirrious.MvvmCross.Dialog.Touch.dll (vnext version)
  • Cirrious.MvvmCross.Plugin.DownloadCache.Touch.dll (vnext version)
  • Cirrious.MvvmCross.Plugin.File.Touch.dll (vnext version)
  • Cirrious.MvvmCross.Plugin.Location.Touch.dll (vnext version)
  • Cirrious.MvvmCross.Plugin.ThreadUtils.Touch.dll (vnext version)
  • CrossUI.Touch.dll (vnext version)
  • System.dll (from /Library/Frameworks/Mono.framework/Libraries/mono/4.5/)
  • System.Windows.dll (from /Library/Frameworks/Mono.framework/Libraries/mono/4.5/)
4

1 回答 1

4

System.Configuration不是 Xamarin.iOS 附带的 BCL 的一部分(既不是程序集也不是命名空间)。

如果您收到此错误,那是因为您(不知何故)将另一个System.dll(来自 Mono 或 MS 的 v2.0?)放入模拟器,这将无法正常工作。

确保您仅引用 Xamarin.iOS 中的 BCL 程序集,问题就会消失。

于 2013-10-17T17:49:45.327 回答