WebClient.DownloadString gives first chance exception
Asked Answered
S

1

6

A call to WebClient.DownloadString gives a first chance exception:

IOException: The specified registry key does not exist.

For some time now I'm recieving first chance exceptions running our software in existing code.

We have the policy that our code should run without giving first change exceptions to make debugging easier.

The first chance exception occurs in the WebClient class when calling the DownloadString and in a remoting scenario where the remote host is unavailable.

Does anyone know how we can prevent this first chance exception?

I'm running VS 2010 on a Windows 8 machine. I don't have any anti virus or firewalls running as far as I know of.

The code is running on x86 mode for the .Net framework 4.0 with debugging enabled. The code is a mix of VB.Net and C#

Spokeswoman answered 6/12, 2012 at 7:36 Comment(2)
I assume you mean first chance exception? As in "the debugger giving you a chance to examine the exception before it goes bang"?Kuhn
This is probably a dupe of the question asked here: #13141934Briard
R
3

It's a .NET issue, Microsoft released an update here:

http://technet.microsoft.com/en-us/security/bulletin/ms12-074

You can add the registery key that is missing your self:

Registry location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework  
DWORD (32-bit) Value name: LegacyWPADSupport
Value data: 0

and for 64bit machines:

Registry location: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework
DWORD (32-bit) Value name: LegacyWPADSupport
Value data: 0
Redemption answered 13/8, 2013 at 17:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.