IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    [原]Mixed mode assembly is built against version \'v1.1.4322\' of the runtime and...问题——C# DirectXSound

    mao0514发表于 2017-06-02 15:18:54
    love 0

    1.问题描述:现在.NET版本一般是4.0,本人在编译低版本的.NET程序在4.0上运行时出现了“Mixed mode assembly is built against version 'v1.1.4322' of the runtime and......”错误——具体是这样的,运行程序没有任何反应,Debug的时候报这个错误。

          2.解决方案:对于这个问题,Microsoft的说法是:http://blogs.msdn.com/b/jomo_fisher/archive/2009/11/17/f-scripting-net-4-0-and-mixed-mode-assemblies.aspx,文中已经提到了解决方案:

          在App.config文件中添加如下内容:

    [html] view plain copy
    1. <startup useLegacyV2RuntimeActivationPolicy="true">  
    2.   <supportedRuntime version="v4.0"/>  
    3. </startup>  

          3.解决方案续:什么?!App.config文件在哪?这里说了:C#配置App.config

          简言之如下:

          右击项目名称,选择“添加”→“添加新建项”,在出现的“添加新项”对话框中,选择“添加应用程序配置文件”;如果项目以前没有配置文件,则默认的文件名称为“app.config”,单击“确定”。出现在设计器视图中的app.config文件为:

    [html] view plain copy
    1. <?xmlversionxmlversion="1.0"encoding="utf-8" ?>  
    2. <configuration>  
    3. </configuration>  
          将要添加的内容加到<configuration> 与 </configuration>之间就可以了。


沪ICP备19023445号-2号
友情链接