6

I am calling this line of code to get to the azure server:

var request = (HttpWebRequest)WebRequest.Create(uri);

and receive this exception. Does anybody know how to manage with it?

mscorlib.dll!Microsoft.Win32.RegistryKey.Win32Error(int errorCode, string str) + 0x189 bytes    
mscorlib.dll!Microsoft.Win32.RegistryKey.GetValueKind(string name) + 0x7f bytes 
System.dll!System.Net.HybridWebProxyFinder.InitializeFallbackSettings() + 0xb8 bytes    
System.dll!System.Net.HybridWebProxyFinder.HybridWebProxyFinder() + 0x1e bytes  
[Native to Managed Transition]  
[Managed to Native Transition]  
System.dll!System.Net.HybridWebProxyFinder.HybridWebProxyFinder(System.Net.AutoWebProxyScriptEngine engine) + 0x37 bytes    
System.dll!System.Net.AutoWebProxyScriptEngine.AutoWebProxyScriptEngine(System.Net.WebProxy proxy, bool useRegistry) + 0x190 bytes  
System.dll!System.Net.WebProxy.UnsafeUpdateFromRegistry() + 0x67 bytes  
System.dll!System.Net.WebProxy.WebProxy(bool enableAutoproxy) + 0x44 bytes  
System.dll!System.Net.Configuration.DefaultProxySectionInternal.DefaultProxySectionInternal(System.Net.Configuration.DefaultProxySection section) + 0x3d9 bytes 
System.dll!System.Net.Configuration.DefaultProxySectionInternal.GetSection() + 0xbe bytes   
System.dll!System.Net.WebRequest.InternalDefaultWebProxy.get() + 0x7e bytes 
System.dll!System.Net.HttpWebRequest.HttpWebRequest(System.Uri uri, System.Net.ServicePoint servicePoint) + 0x18d bytes 
System.dll!System.Net.HttpRequestCreator.Create(System.Uri Uri) + 0x50 bytes    
System.dll!System.Net.WebRequest.Create(System.Uri requestUri, bool useUriBase) + 0x2ec bytes   
System.dll!System.Net.WebRequest.Create(string requestUriString) + 0xa3 bytes   
Alex Blokha
  • 1,141
  • 2
  • 17
  • 30
  • Ok, it seems the solution with LegacyWPADSupport helped, although we have different call stack. – Alex Blokha Mar 25 '13 at 15:58
  • 2
    Yes. This solution helped http://stackoverflow.com/questions/13141434/httpclient-request-throws-ioexception/13745641#13745641, although we have different call stacks. – Alex Blokha Apr 08 '13 at 14:08
  • @AlexBlokha, could you maybe share the answer which worked for you and mark the question as answered? – ardila Sep 09 '14 at 11:52

1 Answers1

3

This solution helped HttpClient request throws IOException , although we have different call stacks.

You need to create these keys in registry.

Path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework

Key:

name: "LegacyWPADSupport" type: "dword" data:00000000

Path: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework

Key:

name: "LegacyWPADSupport" type: "dword" data:00000000

Community
  • 1
  • 1
Alex Blokha
  • 1,141
  • 2
  • 17
  • 30
  • 2
    For completeness, the keys are in: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework and HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework – Rob Sep 25 '14 at 11:37
  • Thanks. The formatting have eaten the slash before the dot (\.). I've edited the answer, for correct display. – Alex Blokha Sep 25 '14 at 11:43