混合模式程序集是针对版本 'v2.0.50727' 构建的 ...本机C++/Visual C++/C# 项目错误



我正在尝试使用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文件的<PropertyGroup Label="Globals">元素,但仍然是错误。

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

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

使用 v90 编译器面向 .Net 3.5

相关内容

最新更新