So this was a really weird one.  The solution is simple but I figured I’d post it in case someone out there was stumped.

Service cannot be started. System.ArgumentException: Delegate to an instance method cannot have null ‘this’.

The problem was with this line of code:

readerThread        = new Thread(new ThreadStart(worker.DoWork));

I was instantiating a new thread that executes the DoWork instance method of the ‘worker’ object.  The problem was that I failed to instantiate the worker object.

The configuration for the service reference could not be updated due to the following issue: Unrecognized element ‘extendedProtectionPolicy’. (App.config / Web.config)

image

There does not seem to be a really clear reason why this is happening however it seems to be related to Windows 7.  I am not sure if the .NET framework that ships with Win7 has some different setting or template for the WCF configuration policy files but it seems to be the culprit.  Maybe the machine.config files are different on Win 7 and the WCF configuration tools use the machine.config as some sort of policy template.

The fix is annoying (because every time you build your solution on Windows 7 and then rebuild on Vista you have to redo this).

Remove the line:

<extendedProtectionPolicy policyEnforcement="Never" />

from both your App/Web.config file on the client and on the WCF server’s Web.config file.