Question

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#

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top