Wednesday, February 16, 2011

the remote server returned an unexpected response: (405) method not allowed using WCF

When you're using WCF and try to check an *.svc file, you get an exception with the next messages:

"the remote server returned an unexpected response: (405) method not allowed ".

And if you try to check the file using IE, you get a http error with the code 404.3.

To solve this problems, run the following command:

C:\Windows\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg -i

With that, the problem has gone.