webClient  请求期间的ex,没有ex的详细信息?对比以前的server 重新设置iis

解决方案 »

  1.   

    ex输出的错误就是An exception occurred during a WebClient request
      

  2.   

    ex输出的错误就是An exception occurred during a WebClient request
    FileDownload:Status:UnknownErrorFileDownload:error:An exception occurred during a WebClient request.FileDownload:error:System.Configuration.ConfigurationErrorsException: Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section. ---> System.DllNotFoundException: Unable to load DLL 'rasapi32.dll': 动态链接库(DLL)初始化例程失败。 (Exception from HRESULT: 0x8007045A)
       at System.Net.UnsafeNclNativeMethods.RasHelper.RasEnumConnections(RASCONN[] lprasconn, UInt32& lpcb, UInt32& lpcConnections)
       at System.Net.UnsafeNclNativeMethods.RasHelper.GetCurrentConnectoid()
       at System.Net.AutoWebProxyScriptEngine.AutoDetector.Initialize()
       at System.Net.AutoWebProxyScriptEngine.AutoDetector.get_CurrentAutoDetector()
       at System.Net.AutoWebProxyScriptEngine..ctor(WebProxy proxy, Boolean useRegistry)
       at System.Net.WebProxy.UnsafeUpdateFromRegistry()
       at System.Net.WebProxy..ctor(Boolean enableAutoproxy)
       at System.Net.Configuration.DefaultProxySectionInternal..ctor(DefaultProxySection section)
       at System.Net.Configuration.DefaultProxySectionInternal.GetSection()
       --- End of inner exception stack trace ---
       at System.Net.Configuration.DefaultProxySectionInternal.GetSection()
       at System.Net.WebRequest.get_InternalDefaultWebProxy()
       at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)
       at System.Net.HttpRequestCreator.Create(Uri Uri)
       at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
       at System.Net.WebRequest.Create(Uri requestUri)
       at System.Net.WebClient.GetWebRequest(Uri address)
       at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
      

  3.   

    是不是需要IIS上设置允许下载.zip格式的文件。右击“默认网站”,属性,http头、MIME类型,新建,...
      

  4.   

    FileDownload:error:System.Configuration.ConfigurationErrorsException: Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.
    创建代理时出错,检查web.config  system.net/defaultProxy配置节
    <system.net>
        <defaultProxy useDefaultCredentials="false">
          <proxy usesystemdefault="True" bypassonlocal="True" autoDetect="True" />
        </defaultProxy>
      </system.net>如果有特定的代理服务器,设置
    <proxy usesystemdefault="False" bypassonlocal="True" autoDetect="True" proxyaddress="IP:port"  />
      

  5.   

    终于解决了,web.config里面加
    <system.net>
        <defaultProxy useDefaultCredentials="false">
          <proxy usesystemdefault="False"/>
        </defaultProxy>
      </system.net>