Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mixed mode assembly is built against version X and cannot be loaded in version Y of the runtime without additional configuration information

After doing some code refactoring, my VS2010 VB.Net Web Application project has stopped compiling with the following error:

"Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information."

In the 'File' column of the Visual Studio's error list is the word 'SGEN', but when I double-click, the file does not exist ("The document cannot be opened. It has been renamed, deleted or moved.") I gather it has something to do with serialization, but what is the required additional configuration information? I've spent a few hours researching the error, and everyone says to add the following to the configuration tab of an app.config file:

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

However, I've added this to every config file I could find or create, and so far it hasn't helped.

I suspect part of the problem might be Crystal Reports, the DLLs for which are indeed built against v1.1.4322 of dot net.

To which config file am I supposed to add the legacyRuntime configuration? Is that even the correct solution?

like image 482
pabrams Avatar asked Mar 19 '12 14:03

pabrams


1 Answers

I got the project to compile by changing 'Generate Serialization Assemblies' from 'Auto' to 'Off' in my app's configuration. The advice all over the internet about useLegacyV2RuntimeActivationPolicy seemed to be a red herring for my situation.

like image 186
pabrams Avatar answered Nov 12 '22 07:11

pabrams