【问题标题】:Mixed mode assembly is built against version 'v2.0.50727' ... error on native C++ / Visual C++ / C# projects混合模式程序集是针对版本“v2.0.50727”构建的...本机 C++/Visual C++/C# 项目上的错误
【发布时间】:2018-02-02 10:32:30
【问题描述】:

我正在尝试使用 Visual C++ 包装器在本机 C++ .exe 项目中实例化 C# 类。

C# 项目以 .Net 3.5 框架为目标,并且无法更改。 C++ 和 Visual C++ 项目都是使用 v100 编译器构建的。

但我仍然收到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

我也试过添加

    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>

到 C++ 项目的 .vcxproj 文件的 &lt;PropertyGroup Label="Globals"&gt; 元素,但仍然是错误。

如果有人有想法,他/她会受到欢迎......

【问题讨论】:

    标签: c# c++ .net wrapper compatibility


    【解决方案1】:

    我自己的愚蠢问题,简单的答案:

    使用 v90 编译器来定位 .Net 3.5

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-08
      • 2013-01-26
      • 2011-09-19
      • 1970-01-01
      • 2023-03-24
      • 2011-04-30
      • 2016-03-29
      • 1970-01-01
      相关资源
      最近更新 更多