无法添加C#.NET4.6.2项目作为C ++项目的参考

编程入门 行业动态 更新时间:2024-10-27 08:34:32
本文介绍了无法添加C#.NET4.6.2项目作为C ++项目的参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们公司过去常常使用VS2010构建一个C ++项目,该项目引用了一个针对.NET 4.0框架的C#项目。 一切似乎都运行良好。

Our company used to use VS2010 to build a C++ project that referenced a C# project that target .NET 4.0 framework. Everything seems to work fine.

然后我们决定转向VS2015专业和最新的.NET框架。解决方案似乎可以正确转换,但是,当我尝试将C#项目更改为目标.NET4.6.2时,引用它的C ++项目开始抱怨不能使用该C#引用中的任何帮助函数。 然后我尝试删除并重新添加项目,我收到以下错误。

Then we decided to move to VS2015 professional and latest .NET framework. Solution seems to be converted properly, however, when I tried to change the C# project to target .NET4.6.2, the C++ project that referenced it start to complain about cannot use any helper function from that C# reference. Then I tried to remove and re-add the project, and I got the following error.

发生了一个或多个错误。

One or more error occurred.

参考< project>无法添加,因为它与此项目不兼容。

A referenced to <project> cannot be added because it is incompatible with this project.

C ++项目默认使用:

The C++ project default using:

目标平台版本:8.1

Target Platform Version: 8.1

平台工具集:Visual Studio 2015(v140)

Platform Toolset: Visual Studio 2015 (v140)

我已将Target Platform更改为10.0.14393.0。 问题仍然​​存在。

I've changed Target Platform to 10.0.14393.0. Problem still exist.

然后我尝试将C#项目更改为目标.NET 4.6或4.5,我仍然无法将项目添加到C ++项目,直到我将其更改回来到.NET 4然后它允许我添加。

Then I tried to change the C# project to target .NET 4.6 or 4.5, I still can't add the project to the C++ project until I change it back to .NET 4 then it allows me to add.

任何帮助将不胜感激。

谢谢,

Gary

推荐答案

您好,

您还应该更改C ++ \ CLI项目目标版本,用于卸载然后右键单击它并选择"Edid --- .vcxproj"。将目标框架替换为4.6.1保存并重新加载项目。现在再试一次添加引用。

You should also change your C++\CLI project target version, for that unload It then right click on it and select "Edid ---.vcxproj" replace target framework to 4.6.1 save and reload project . Now try again add reference.

更多推荐

无法添加C#.NET4.6.2项目作为C ++项目的参考

本文发布于:2023-11-06 17:42:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1564360.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!