VS2010项目依赖
我在 VS2010 和 ac# 项目中有一个 C++ 项目,该项目将使用此 C++ 项目输出(它将其用于 p/invoke)。我想我可以通过编辑解决方案中的“项目依赖项...”来确保 c++ 项目在 c# 项目之前构建,但这似乎没有任何效果,我的构建服务器上的构建不尊重此设置(我正在使用 TeamCity 引导构建整个解决方案文件的 MSBuild 文件)
我认为这曾经有效,VS2010 有什么变化吗?或者我应该以另一种方式声明依赖关系?
解决方案:诀窍是在 VS2010 之外手动编辑 csproj 文件并添加如下部分:
<ProjectReference Include="..\CobraLib\CobraLib.vcxproj">
<Project>{598506DA-91DA-4F25-948D-A14CB16ABEBA}</Project>
<Name>CobraLib</Name>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
这使得构建服务器以正确的顺序处理我的项目。唯一需要注意的是 VS2010 在项目引用上显示错误(“不是 .NET 项目”),但除此之外一切都按我的预期运行
I have a c++ project in VS2010 and a c# project that is to consume this c++ project output (it uses it for p/invoke). I was thinking that I could ensure that the c++ project was build before the c# project by editing the "Project dependencies..." in the solution but this does not seem to have any effect, the build on my buildserver does not respect this setting (I'm using TeamCity to bootstrap an MSBuild file that builds the entire solution file)
I think this used to work, has anything changed with VS2010? Or should I declare the dependency in another way?
SOLUTION: The trick was to hand-edit the csproj file outside VS2010 and add a section like this:
<ProjectReference Include="..\CobraLib\CobraLib.vcxproj">
<Project>{598506DA-91DA-4F25-948D-A14CB16ABEBA}</Project>
<Name>CobraLib</Name>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
That made the build server process my projects in the correct order. Only caveat is that VS2010 displays an error on the project reference ("not a .NET project") but otherwise things are working as I intended
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论