20

I am getting an error: "The specified registry key does not exist" when the following WCF code is being executed:

return base.Channel.GetRateSheet(request);

This is the rest of the method in which this is used:

public GetRateSheetResponse GetRateSheet(GetRateSheetRequest request)
{
    return base.Channel.GetRateSheet(request);
} 

The config for this endpoint is:

<endpoint address="http://*********/*******/Service.svc"
          binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IBusinessService"
          name="Endpoint_RateSheetService"
          contract="*********.RateSheetService" />

This code used to work for many weeks, and this morning is started throwing this error.

There is no inner exception and the only stack trace I get is:

at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)

I did all the common tire-kicking: restarted VS, rebooted machine, got latest version of the source code.

Running XP 32 bit.

[EDIT:] When I go to the bin folder of the solution and run the executable direcly, it works - no error. The error only occurs when running from Visual Studio

Cœur
  • 37,241
  • 25
  • 195
  • 267
Paceman
  • 2,095
  • 4
  • 20
  • 27

3 Answers3

36

Seems people have faced similar issues after installing a security patch for the .NET Framework: MS12-074: Vulnerabilities in .NET Framework could allow remote code execution: November 13, 2012

You can ask microsoft to fix it here

Workaround - Add the following registry key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"LegacyWPADSupport"=dword:00000000

For 64 bit machines

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework]
"LegacyWPADSupport"=dword:00000000 
Community
  • 1
  • 1
nunespascal
  • 17,584
  • 2
  • 43
  • 46
5

I ran into this issue while debugging something today. The exception goes away if you check the "Just my code" option in the debugging settings inside VS.

0

Go to --> Debug-->Exceptions and uncheck "Common Language Runtime Exceptions"

This should reslove issue.

Manoj
  • 397
  • 2
  • 6