Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 在Mono中配置System.Net时出现问题_Asp.net_.net_Mono_Web Config - Fatal编程技术网

Asp.net 在Mono中配置System.Net时出现问题

Asp.net 在Mono中配置System.Net时出现问题,asp.net,.net,mono,web-config,Asp.net,.net,Mono,Web Config,我已尝试在Mono项目的Web.config中配置System.net节点 我一直得到这样的例外: System.Configuration.ConfigurationErrorsException Error deserializing configuration section defaultProxy: Unrecognized attribute 'enabled'. (/usr/share/nginx/aspnet/Web.config line 1) Description: HT

我已尝试在Mono项目的Web.config中配置System.net节点

我一直得到这样的例外:

System.Configuration.ConfigurationErrorsException
Error deserializing configuration section defaultProxy: Unrecognized attribute 'enabled'. (/usr/share/nginx/aspnet/Web.config line 1)

Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): System.Configuration.
Exception stack trace:
  at System.Configuration.ConfigurationSection.DeserializeSection (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  at System.Configuration.Configuration.GetSectionInstance (System.Configuration.SectionInfo config, Boolean createDefaultInstance) [0x00000] in <filename unknown>:0 
  at System.Configuration.ConfigurationSectionCollection.get_Item (System.String name) [0x00000] in <filename unknown>:0 
  at System.Configuration.Configuration.GetSection (System.String path) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.HttpConfigurationSystem.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.GetDefaultWebProxy () [0x00000] in <filename unknown>:0 
  at System.Net.WebRequest.get_DefaultWebProxy () [0x00000] in <filename unknown>:0 
  at System.Net.GlobalProxySelection.get_Select () [0x00000] in <filename unknown>:0 
  at System.Net.HttpWebRequest..ctor (System.Uri uri) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Net.HttpWebRequest:.ctor (System.Uri)
  at System.Net.HttpRequestCreator.Create (System.Uri uri) [0x00000] in <filename unknown>:0 
  at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.GetWebRequest (System.Uri address) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.SetupRequest (System.Uri uri) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.OpenRead (System.Uri address) [0x00000] in <filename unknown>:0 
System.Configuration.ConfigurationErrorsException
反序列化配置节defaultProxy时出错:无法识别的属性“enabled”。(/usr/share/nginx/aspnet/Web.config第1行)
描述:HTTP 500。处理请求时出错。
详细信息:非web异常。异常源(应用程序或对象的名称):System.Configuration。
异常堆栈跟踪:
在:0中的System.Configuration.ConfigurationSection.DeserializeSection(System.Xml.XmlReader reader)[0x00000]处
在:0中的System.Configuration.Configuration.GetSectionInstance(System.Configuration.SectionInfo配置,布尔createDefaultInstance)[0x00000]处
在0中的System.Configuration.ConfigurationSectionCollection.get_项(System.String名称)[0x00000]处
在:0中的System.Configuration.Configuration.GetSection(System.String路径)[0x00000]处
位于:0中的System.Web.Configuration.WebConfiguration Manager.GetSection(System.String sectionName、System.String路径、System.Web.HttpContext上下文)[0x00000]处
在:0中的System.Web.Configuration.WebConfiguration Manager.GetSection(System.String sectionName)[0x00000]处
在:0中的System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IIInternalConfigSystem.GetSection(System.String configKey)[0x00000]处
在:0中的System.Configuration.ConfigurationManager.GetSection(System.String sectionName)[0x00000]处
位于:0中的System.Net.WebRequest.GetDefaultWebProxy()[0x00000]处
在System.Net.WebRequest.get_DefaultWebProxy()[0x00000]中:0
在System.Net.GlobalProxySelection.get_Select()[0x00000]中:0
位于:0中的System.Net.HttpWebRequest..ctor(System.Uri)[0x00000]处
位于(带检查的包装器远程处理调用)System.Net.HttpWebRequest:.ctor(System.Uri)
在:0中的System.Net.HttpRequestCreator.Create(System.Uri)[0x00000]处
在System.Net.WebRequest.Create(System.Uri requestUri)[0x00000]中:0
位于:0中的System.Net.WebClient.GetWebRequest(System.Uri地址)[0x00000]处
位于:0中的System.Net.WebClient.SetupRequest(System.Uri)[0x00000]处
位于:0中的System.Net.WebClient.OpenRead(System.Uri地址)[0x00000]处
我不知道如何让我的应用程序接受enabled属性设置为true的defaultProxy节点,或者使用其他一些设置


如果我从Web.config中删除System.net节点,则应用程序中使用WebClient的部分将超时。

我相信您在mono中发现了一个错误。这是一个错误,因此配置读取器不知道它们

请注意,
enabled
属性的默认值为
true
,因此您可以忽略该设置作为解决问题的方法

尽管如此,请在亡灵术中报告此错误。
要绕过此错误,您可以设置

System.Net.WebRequest.DefaultWebProxy 
使无效或使无效

new System.Net.WebProxy();
在您执行WebRequest之前

例如:

System.Net.WebRequest.DefaultWebProxy = null;
System.Net.WebRequest.DefaultWebProxy = new System.Net.WebProxy();


System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)
System.Net.WebRequest.Create(URL);

是否为此报告了错误?未提交错误,但现在应通过以下方法修复:)