"Error creating the web proxy" exception calling Web Service from a .NET Executable on a Network Share
Wednesday, January 25, 2012 7:49 PM
I have seen a lot of posts regarding an issue where a "Error creating Web Proxy" exception is thown from within a Windows Forms application that is hosted on a network share tries to connect to a Web Service. This appears to only occur under Windows Server 2008 R2 (x64), and it runs fine from within Windows Server 2003 (x86)
The workarounds that I have seen are to copy the executable to a local drive. That workaround doesn't work well with us as we want to store our VS code on a network share for backup purposes.
We have run the CASPOL to grant "Full Trust" to all Trusted Sites, and these network shares are from within our domain.
Does anyone out there have a solution that doesn't involve running the .exe from a local drive?
Message=Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.
BareMessage=Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.
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.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri)
at System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri uri)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object parameters)
at Canwest.Broadcasting.Windows.Classes.CW_Common_2008.INCWebService.InfoCentral.GetReportParameters(Int64 plReportInstanceID)
at Canwest.Broadcasting.Windows.Classes.CW_Common_2008.InfoCentral.GetReportParameters(Int64 plReportInstanceID)
Message=An invalid argument was supplied
at System.Net.SafeCloseSocketAndEvent.CreateWSASocketWithEvent(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, Boolean autoReset, Boolean signaled)
at System.Net.AutoWebProxyScriptEngine..ctor(WebProxy proxy, Boolean useRegistry)
at System.Net.Configuration.DefaultProxySectionInternal..ctor(DefaultProxySection section)
Friday, April 13, 2012 7:24 PM
OK, so after about two months of cricket chirping silence, and 745 reads of this post, I will answer my own post as I found a workaround.
The workaround is to set your "Output Path" in the Build tab of the project options to a local disk/folder, and not to the network drive where the code resides (which is the default). In my case, I set it to C:\_Build\<projectname>.
This resolves the issue. I am quite surprised that nobody else has experienced this issue as it happens on all of our x64 Window Server 2008 R2 developer systems.
I hope that this will be helpful to somebody else out there.
- Proposed As Answer by Iric Wen Friday, May 04, 2012 7:05 AM
Monday, May 14, 2012 3:25 PM
We are experiencing the same problem which is also mentionned in this thread :
In our case, it works well from one network share but not from another one. It has to do with read permissions on the root of the share.
I have yet to find a solution. If I do, I'll post the reply here. In my book, it is a Windows bug : what does the root folder permission have to do with the ability of an executable to open a socket ?...