混合模式程序集是针对版本 X 构建的,如果没有附加配置信息,则无法在运行时版本 Y 中加载 [英] Mixed mode assembly is built against version X and cannot be loaded in version Y of the runtime without additional configuration information

查看:13
本文介绍了混合模式程序集是针对版本 X 构建的,如果没有附加配置信息,则无法在运行时版本 Y 中加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在做了一些代码重构之后,我的 VS2010 VB.Net Web Application 项目已经停止编译,出现以下错误:

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

混合模式程序集是针对运行时版本‘v1.1.4322’构建的,如果没有额外的配置信息,则无法在 4.0 运行时中加载."

"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."

在Visual Studio的错误列表的'File'栏中是'SGEN'这个词,但是当我双击时,该文件不存在(无法打开该文档.它已被重命名,删除或移动.") 我认为它与序列化有关,但需要的附加配置信息是什么?我花了几个小时研究这个错误,每个人都说将以下内容添加到 app.config 文件的配置选项卡中:

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.

我怀疑问题的一部分可能是 Crystal Reports,其 DLL 确实是针对 dot net 的 v1.1.4322 构建的.

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

我应该将 legacyRuntime 配置添加到哪个配置文件?这甚至是正确的解决方案吗?

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

推荐答案

我通过在我的应用程序配置中将生成序列化程序集"从自动"更改为关闭"来编译项目.互联网上关于 useLegacyV2RuntimeActivationPolicy 的建议似乎是我的情况的红鲱鱼.

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.

这篇关于混合模式程序集是针对版本 X 构建的,如果没有附加配置信息,则无法在运行时版本 Y 中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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