Mixed mode assembly is built against version 'v1.1.4322'

与世无争的帅哥 提交于 2019-12-17 05:05:47

问题


i've included a directX player in c# .net 4.0 app that is included here ( answer2 ) . The problem is that when i try to initialize the object ( i.e. Player mPlayer=new Player()) this error occurs :

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.

Anyone knows what it can be?


回答1:


You need to add an app.Config file and set useLegacyV2RuntimeActivationPolicy to true.

This is required to use mixed mode CLR 2 assemblies in a .NET 4 application.




回答2:


The way I fixed this error was by changing the 'configuration' node on my app.config from this:

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

to this:

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



回答3:


Here is possible assembly configuration:

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


来源:https://stackoverflow.com/questions/4018924/mixed-mode-assembly-is-built-against-version-v1-1-4322

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