Friday, February 25, 2011

Woe with upgrading to 4-Oh

When upgrading to .net 4.0 you can run into a nasty little compiler error that looks like this:
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

It's important to note this particular error is a compiler error and not a runtime error. There is a runtime error with the exact same text, and just requires some config changes. If you're getting the runtime version, find the solution here-ish. Otherwise, you need to change your project's config a little.

Go to your project properties -> Build tab -> Scroll down to Generate serialization assembly and turn that puppy off. Enjoy a working build again.