CMake-Made VS2010中的C#项目解决方案必须卸载/重新加载,以避免被跳过 [英] C# Projects in CMake-Made VS2010 Solution Must Be Unloaded/Reloaded to Avoid Being Skipped

查看:620
本文介绍了CMake-Made VS2010中的C#项目解决方案必须卸载/重新加载,以避免被跳过的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用CMake生成一个VS2010解决方案与两个C / C + +项目:本机控制台应用程序,静态库和本机DLL;和C#项目:托管控制台应用程序和托管DLL。

我使用CMake与 include_external_msproject + CONFIGURE_FILE 技术此处

I'm using CMake to generate a VS2010 solution with both C/C++ projects: native console app, static libs and native DLL; and C# projects: managed console app and managed DLL.
I'm using CMake with the include_external_msproject + CONFIGURE_FILE technique as described e.g. here.

但是,生成的解决方案会保持跳过构建的C#项目。

按照,如果我卸载项目,然后重新加载项目项目现在正确建立。

我必须每次用CMake重新生成解决方案时这样做。

However, the resulting solution keeps skipping the build of the C# projects.
Following this, if I "Unload Project" and then "Reload Project" the projects now build properly.
I must do this every time I re-"Generate" the solution with CMake.

为什么会发生这种情况?

有没有办法避免这种情况?

Why is this happening?
Is there a way to avoid this?

推荐答案

在这里也有同样的问题。

Had the same problem here.

我们的cmake生成的解决方案为Win32和x64平台创建了配置,而外部C#项目有x86和x64平台。 cmake生成解决方案后,所有项目(内部和外部)都设置为使用平台Win32。 (检查解决方案配置管理器。)

Our cmake generated solution created configurations for Win32 and x64 platforms while the external C# project had x86 and x64 platforms. After cmake generated the solution, all projects (internal and external) are set to use platform Win32. (Check the solutions Configuration Manager.)

要强制cmake将外部项目包括为x86,请在调用include_external_msproject时指定PLATFORM参数。

To force cmake to include the external projects as x86, specify the PLATFORM parameter when calling include_external_msproject.

include_external_msproject(TestApp "/TestApp/TestApp.csproj" PLATFORM x86)

(当然,请确保你只是为x86版本...)

(And of course ensure that you just do this for the x86 version...)

这篇关于CMake-Made VS2010中的C#项目解决方案必须卸载/重新加载,以避免被跳过的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆