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

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 04:09:15

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/9772265/mixed-mode-assembly-is-built-against-version-x-and-cannot-be-loaded-in-version-y

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!