2013-03-25 27 views
6

私は紺碧のサーバーに到達するためにこのコード行を呼び出しています:WebRequest.Create throw IOException "指定されたレジストリキーが存在しません。"

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

とこの例外が発生しました。 それを管理する方法を誰かが知っていますか?

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 
+0

これは、LegacyWPADSupportのソリューションが役に立ちましたが、私たちは別の呼び出しスタックを持っています。 –

+0

あなたはこれを解決しましたか? – skimania

+2

はい。このソリューションは、さまざまなコールスタックを持っていますが、http://stackoverflow.com/questions/13141434/httpclient-request-throws-ioexception/13745641#13745641を助けました。 –

答えて

3

この解決策はHttpClient request throws IOExceptionに役立ちましたが、私たちはさまざまな呼び出しスタックを持っています。

レジストリにこれらのキーを作成する必要があります。

名: "LegacyWPADSupport" タイプ: "DWORD" データ:00000000

パスします。HKEY_LOCAL_MACHINE \ SOFTWARE \ WOW6432NODEマイクロソフト\

パス:マイクロソフト\ .NETFramework

キーHKEY_LOCAL_MACHINE \ SOFTWARE \ \ .NETFramework

キー:

名: "LegacyWPADSupport" タイプ: "DWORD" データ:00000000

+2

完全性のために、キーは HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ .NETFrameworkおよび HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Microsoft \ .NETFramework – Rob

+0

にあります。書式設定では、ドット(\。)の前にスラッシュを入れています。私は正しい表示のために答えを編集しました。 –

関連する問題