Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF: The specified registry key does not exist in base.Channel call

Tags:

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

like image 548
Paceman Avatar asked Jan 21 '13 03:01

Paceman


2 Answers

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 
like image 172
nunespascal Avatar answered Oct 21 '22 08:10

nunespascal


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.

like image 33
Senthil Ramanathan Avatar answered Oct 21 '22 10:10

Senthil Ramanathan