Sunday, December 2, 2012

Method not found exception with WCF

I had a WCF client for a web service, it was working fine from my machine, when I deployed my application to other machines, I was getting the below exception

System.MissingMethodException: Method not found: 'Void System.ServiceModel.Channels.SecurityBindingElement.set_AllowInsecureTransport(Boolean)'.

When I searched online I found out that this could happen when .NET framework is not installed. I tried installing .NET framework 3.5 SP1 on these machines, but it was always failing since this machines OS is windows 7, and I was getting error that I should use “Turn windows features on or off” to install .NET framework 3.5, which was already installed by this way

I searched more, and I found out that there is hot fix for WCF that adds AllowInsecureTransport  property to the SecurityBindingElement class, and i was using this on my WCF client

http://social.msdn.microsoft.com/Forums/en-US/wcfprerelease/thread/c12cf16f-20b9-4204-b05c-342fc33d0727/

I found couple of updates for .NET framework 3.5 SP1, non of them installed successfully, there were errors in setup, either product not found, or things like this

Finally I found one that I was able to install from the link below

http://support.microsoft.com/kb/976462/en-us

I downloaded the x86 file Windows6.1-KB976462-v2-x86.msu from https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=23806 , installed it on the machines, then the application worked without any exceptions