混合模式组件构建针对运行时的版本“V2.0.50727” [英] Mixed mode assembly is built against version ‘v2.0.50727′ of the runtime

查看:356
本文介绍了混合模式组件构建针对运行时的版本“V2.0.50727”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下异常:

混合模式组件构建针对运行时的版本V2.0.50727',不能在4.0运行时无需附加配置信息加载。

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.

因为我想从我的WPF程序导出水晶报表...

as I was trying to export crystal report from my WPF program...

我添加了以下在App.config已经...

I have added the following in the app.config already...

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

任何专家可以帮助????

Any experts can help????

参考我发现: <一href="http://www.davidmoore.info/2010/12/17/running-net-2-runtime-applications-under-the-net-4-runtime">http://www.davidmoore.info/2010/12/17/running-net-2-runtime-applications-under-the-net-4-runtime

推荐答案

尝试在配置节点使用这个确切的启动标签在你的app.config

Try to use this exact startup tag in your app.config under configuration node

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

这篇关于混合模式组件构建针对运行时的版本“V2.0.50727”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆