1
我试图使用设置“Mono 2.10.2”在Mono中构建应用程序,但出现以下错误。WebRequest超时错误
Unhandled Exception: System.Net.WebException: The request timed out
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00046] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.6.7\mcs\class\System\System.Net\HttpWebRequest.cs:813
at System.Net.HttpWebRequest.GetResponse() [0x0000e] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.6.7\mcs\class\System\System.Net\HttpWebRequest.cs:825
的代码导致此问题的位是:
string url = "http://webFarm/config.prop";
WebRequest req = WebRequest.Create(url);
WebResponse resp = req.GetResponse();
它立即失败。但如果我将设置切换到“默认运行时”而不是“Mono 2.10.2”,则一切正常。任何人都可以帮助我吗?
问候, 大卫
我猜想Windows上的'Default Runtime'意味着MS.Net。地址http://webFarm/config.prop是否可以使用普通浏览器访问? – skolima 2011-06-16 13:03:27
感谢您的回复。是的,它是可及的。正如我所提到的,使用'Default Runtime',我们确实得到了预期的结果。此应用程序最初编码在Windows下。 – David 2011-06-17 12:36:47
您是否尝试在'app.config'中更改超时以查看会发生什么? – j4x 2011-06-21 11:10:51