混合模式装配是针对版本X构建的,不能在没有其他配置信息的运行时版本Y中加载 [英] Mixed mode assembly is built against version X and cannot be loaded in version Y of the runtime without additional configuration information

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

问题描述

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



混合模式程序集是针对版本'v1 .1.4322,并且不能在4.0运行时加载,而不需要其他配置信息。



在Visual Studio的错误列表的文件列中是单词SGEN,但是当我双击时,文件不存在无法打开它已被重命名,删除或移动。)我收集它与序列化有关,但是当我删除我的序列化库的引用,错误不会消失(当然,我得到一个更多错误,因为现在我试图使用一个未引用的库)。



那么,所需的额外配置信息是什么?我花了几个小时研究错误,大家都说要在app.config文件的配置标签中添加以下内容:

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

但是,我已经添加到每个可以找到或创建的配置文件,没有帮助。



我怀疑问题的一部分可能是水晶报表,其DLL是确实构建的对点网络的v1.1.4322。但这只是一个猜测;水晶只是通常的嫌疑人。



我需要再次编译我的项目。为此,我有一些问题:


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

  2. 任何人都可以帮助demystify Asp.Net配置吗?

  3. 为什么Visual Studio列出引用不存在的文件的错误?

  4. 这是什么混合模式baloney是什么?

  5. 为什么这样奇怪的配置问题似乎突然间断地,任何重大变化?
  6. 设为关闭。关于useLegacyV2RuntimeActivationPolicy在互联网上的建议似乎是一个红色的鲱鱼为我的情况。


    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 when I remove my reference to the Serialization library, the error does not go away (and of course I get a bunch more errors because now I'm trying to use an unreferenced library).

    So 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. But that's only a guess; Crystal is just the usual suspect.

    I need to get my project compiling again. To that end, I have some questions:

    1. To which config file am I supposed to add the legacyRuntime configuration? Is that even the correct solution?
    2. Can anyone help demystify Asp.Net configuration for me? Does it actually make any sense or is it as ridiculous as it seems?
    3. Why does Visual Studio list an error referencing a file that doesn't exist?
    4. What is this mixed mode baloney anyway?
    5. Why do weird configuration problems like this seem to crop up intermittently when to my knowledge I have not made any significant changes?

    解决方案

    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天全站免登陆