如何在BuildServer建立VS2010 C ++项目 [英] How to build a VS2010 C++ Project on a BuildServer

查看:157
本文介绍了如何在BuildServer建立VS2010 C ++项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个托管C ++ .NET解决方案assemlby瞄准.NET 3.5与VS2010创建的。命令:

 %WINDIR%\\ Microsoft.NET \\框架\\ v4.0.30319 \\ MSBuild.exe MyProject.sln

编译我的开发机器上的解决方案。

在我BuildServer我得到这个错误:


  

构建失败。


  
  

F:\\ CruiseControl.NET \\项目\\ MyProject的\\ MyProject.sln
  (默认目标)(1) - >
  F:\\ CruiseControl.NET \\项目\\ MyProject的\\ MyProject的\\ MyProject.csproj
  (默认目标)(2) - >
  F:\\ CruiseControl.NET \\项目\\ MyProject的\\ MyProjectMAPIHelper \\ MyProjectMAPIHelper.vcxproj
  (默认目标)(3) - >结果
  F:\\ CruiseControl.NET \\项目\\ MyProject的\\ MyProjectMAPIHelper \\ MyProjectMAPIHelper.vcxproj(23,3):
  错误MSB4019:导入项目
  C:\\ PROGRAM
  FILES \\的MSBuild \\ Microsoft.Cpp \\ V4.0 \\ Microsoft.Cpp.Default.props
  没找到。确认路径
  在<进出口GT; 声明
  正确的,并且该文件存在于
  磁盘。

  0警告(S)
1个错误


在我开发的机器所要求的文件


  

C:\\ Program Files文件\\的MSBuild \\ Microsoft.Cpp \\ V4.0 \\ Microsoft.Cpp.Default.props


存在。在我的构建服务器没有。

当我尝试(在同一个目录和所有其他人)这个文件复制发生其他错误。因此,这是错误的方法。

修改:其他错误是指:当我复制构建服务器上的文件Microsoft.Cpp.Default.props的MSBuild声称其他文件。这说明我来说,这只是在做丢失的文件的副本,是不是有什么构建环境的期待。我要寻找一个MSI /什么包,我可以安装我的构建服务器和任何C ++项目将建立在。安装SDK并没有获得成功。或者,我做了一件SDK安装过程中出错。或者,这是不可能编译托管C ++ VS2010的解决方案正好与SDK。

我相信其他错误无关我的问题。我的问题是:如何正确地设置我的生成环境。 /修改

我做了什么至今:


  • 我已经安装了最新的Win7 SDK (http://blogs.msdn.com/b/windowssdk/archive/2010/05/25/released-windows-sdk-for-windows-7-and-net-framework-4.aspx)

  • 我针对.NET 3.5

  • 我试着平台工具箱物业玩 - 但它只是在玩

  • 在我的解决方案有一个托管C ++组件(我的问题)

  • 我使用的MSBuild 4.0,因为新的VS2010的项目文件不能用的MSBuild 3.5
  • 编译
  • 我使用CC.NET。汇编CC.NET的的命令行上失败。因此,它不应该是一个CC.NET问题。

是否有如何正确配置我的项目我的dev的机器上编译VS2010的任何提示和技巧和的我的生成服务器上?还有什么更多的安装(除VS2010)?

谢谢,亚瑟


解决方案

目前,安装VS 2010是你唯一安全的选择。在Windows SDK将被更新,以使您的场景,但我没有一个具体的发布日期。在那之前,你需要为你打造2010解决方案与C ++项目与C ++工具来安装VS 2010。请确保你让C ++团队知道通过自己的团队博客这种情况怎么不满和/或 MSDN论坛

即使安装VS 2010之后,您可能需要正确地调用合适的vcvars * .bat文件设置环境变量。

I've a .NET Solution with a managed C++ assemlby Targeting .NET 3.5 created with VS2010. The command:

%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MyProject.sln

compiles the solution on my dev machine.

On my BuildServer I get this error:

Build FAILED.

"F:\CruiseControl.NET\Projects\MyProject\MyProject.sln" (default target) (1) -> "F:\CruiseControl.NET\Projects\MyProject\MyProject\MyProject.csproj" (default target) (2) -> "F:\CruiseControl.NET\Projects\MyProject\MyProjectMAPIHelper\MyProjectMAPIHelper.vcxproj" (default target) (3) ->
F:\CruiseControl.NET\Projects\MyProject\MyProjectMAPIHelper\MyProjectMAPIHelper.vcxproj(23,3): error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

0 Warning(s)
1 Error(s)

On my dev machine the claimed file

"C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.Default.props"

exists. On my build server not.

When I try to copy this files (and all others in the same directory) other errors occurred. So this is the wrong way.

EDIT: other errors means: When I copy the file "Microsoft.Cpp.Default.props" on the build server, MSBuild is claiming other files. That shows me, that just doing a copy of missing files is not what the build environment is expecting. I am looking for an MSI/whatever package that I could install on my build server and any C++ Project will build. Installing the SDK did not the trick. Or I did something wrong during SDK installation. Or it is not possible to compile Managed C++ VS2010 Solutions just with the SDK.

I believe that "other errors" has nothing to do with my problem. My Problem is: "How do I setup my build environment correctly". /EDIT

What I've done till now:

  • I have installed the latest Win7 SDK (http://blogs.msdn.com/b/windowssdk/archive/2010/05/25/released-windows-sdk-for-windows-7-and-net-framework-4.aspx)
  • I am targeting .net 3.5
  • I've tried playing with the Platform Toolset Property - but it was just playing
  • In my solution there is a managed C++ Assembly (my Problem)
  • I am using MSBuild 4.0 because the new VS2010 project files cannot be compiled with MSBuild 3.5
  • I am using CC.NET. compilation fails in CC.NET and on the command line. So it should not be a CC.NET issue.

Are there any tips and tricks how to configure my project properly to compile on my dev machine with VS2010 and on my build server? Is there anything more to install (except VS2010)?

Thanks, Arthur

解决方案

For now, installing VS 2010 is your only safe option. The Windows SDK will be updated to enable your scenario, but I don't have a specific release date. Until then, you'll need to install VS 2010 with the C++ tools in order to build your 2010 solution with C++ projects. Make sure you let the C++ team know about how dissatisfaction with this situation via their team blog and/or MSDN Forum.

Even after installing VS 2010, you may need to invoke the appropriate vcvars*.bat file to setup your environment variables correctly.

这篇关于如何在BuildServer建立VS2010 C ++项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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