David Sandor

Build succeeded.

Expression Flip / Flip Wire Up Code / Code Cheat

clock September 18, 2009 05:51 by author dsandor

I wrote this application a long time ago and found it on a backup drive.  As it turns out it was quite useful for those times you are having to (for example) write code that wires up an object to a bunch of user controls and visa versa (yes yes, you should be using data binding)

image

Code to be attached shortly..



Solved: Delegate to an instance method cannot have null ‘this’.

clock September 12, 2009 01:49 by author dsandor

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.



Workaround: The configuration for the service…Unrecognized element ‘extendedProtectionPolicy’.

clock September 11, 2009 07:11 by author dsandor

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.

 

 



About the author

David Sandor is a Software Architect working in Chicago, IL.  My development focuses around the Microsoft Stack including Azure, AppFabric, Silverlight, WPF, .NET Framework, and various mobile devices including iOS (iPhone/iTouch), Android, Windows Mobile and Windows Phone 7.

Month List

Sign in