本文介绍了如何建立一个VS2010文件项目(vcxproj)与TFS生成(无VS 2010)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个是建设优良在VS 2008中的一个项目,然后我们安装并开始使用TFS生成,然后我们升级到TFS 2010年一切都还是很好,建设正确(后我实现了我们新的构建过程,使得一切都非常好与任何远程的Visual Studio 2010客户端的单点击生成启动)。 Visual Studio中并不需要对生成代理安装。我非常努力(的非常的硬)不要安装在生成代理的Visual Studio,因为我的理解是,这是没有必要的,而且我们没有授权给非开发机器上安装它

I have a project that was building fine in VS 2008, and then we installed and started using TFS Build, and then we upgraded to TFS 2010. Everything was still fine and building correctly (after I implemented our new build process that made everything very nice with a single-click build initiation from any remote Visual Studio 2010 client). Visual Studio did not need to be installed on the Build Agent. I'm trying very hard (very hard) not to install Visual Studio on the Build Agent because my understanding is that it's not necessary, and we're not licensed to install it on a non-development machine.

现在我试图解决方案升级到Visual Studio 2010,还是面向.NET 3.5,因为它是针对SQL Server的CLR过程的组件,以及SQL Server不支持.NET 4.0呢。但我根本无法让更多的建立在TFS生成。我似乎无法得到TFS一致的错误信息生成并从MS Build命令行,但我认为它是与Microsoft.Cpp.Targets不是在C:\ Program Files文件\的MSBuild \,因为我的天堂T安装了Visual Studio。我没有安装Microsoft Windows SDK 7.1,这样我可以运行.NET 4.0 SDK工具,如SvcUtil工具的一些其他.NET 4.0的项目,但似乎没有安装此版本想要的东西。错误TFS版本给我的是:

Now I tried upgrading the solution to VS 2010, still targeting .NET 3.5 because it's an assembly targeted for SQL Server CLR procedures, and SQL Server doesn't support .NET 4.0 yet. But I simply cannot make it build any more under TFS Build. I can't seem to get a consistent error message from TFS Build and from an MS Build command line, but I think it has something to do with Microsoft.Cpp.Targets not being in C:\Program Files\MSBuild\ because I haven't installed Visual Studio. I did install the Microsoft Windows SDK 7.1 so that I could run the .NET 4.0 SDK tools like svcutil for some other .NET 4.0 projects, but nothing seems to install what this build wants. The error TFS build gives me is:

C:\ TFSBld [...] \ GenerateLanguage \ GenerateLanguage.vcxproj(46,3):  错误MSB4019:导入的项目  C:\ Microsoft.Cpp.Default.props是  未找到。确认,在该路径  该声明是正确的,  而该文件存在于磁盘上。

当我点击这个错误就带我到这条线在vcxproj文件:

And when I click on that error it takes me to this line in the vcxproj file:

  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

我真正需要做的这个项目运行RESGEN生成的RESX文件的资源文件,并将其编入sattelite组件。我用一个makefile建设要做到这一点,手动运行RESGEN(我想这是因为我无法找到一个方法来编译sattelite组件作为一个独立的解决方案的任何其他方式),然后编译这些成DLL(我不记得怎么说现在的工作,但我认为它是手动运行Al.exe工具使用的资源文件编译DLL文件)。所以基本上我只需要运行命令行来打造这个项目,我似乎无法找到一个合理的方式来做到这一点,而没有引发出整个项目,并编辑TFS生成脚本来运行了一堆硬$ C $的cd命令行来代替。我们有了一个更好的办法。

All I really need to do in this project is run resgen to generate resources files from resx files, and compile them into sattelite assemblies. I was using a makefile build to do this, manually running resgen (I think it was because I can't find a way to compile sattelite assemblies as a stand-alone solution any other way), and then compile those into a DLL (I can't remember how that worked now, but I think it was manually running AL.exe to compile DLL files from resources files). So basically I just need to run command lines to build this project, and I can't seem to find a reasonable way to do it without throwing out the entire project and editing the TFS build script to run a bunch of hard-coded command lines instead. There's got to be a better way.

我一直在这个整天,并试图写我自己的.targets文件和.xml属性表采取的标准文件的地方,但它是在我头上的方式。我试图简单地删除线,但随后的MSBuild抱怨,有没有构建的目标。我尝试添加一个虚拟的vcxproj文件,但它似乎没有运行pre和生成后,所有的工作完成的步骤。

I've been at this all day, and tried writing my own .targets file and .xml property sheets to take the place of the standard file, but it's way over my head. I tried simply deleting the lines, but then MSBuild complains that there's no "Build" target. I tried adding a dummy to the vcxproj file, but then it didn't seem to run the pre- and post-build steps where all the work is done.

推荐答案

在Microsoft Windows SDK 7.1有几个安装选项。只具有.NET开发孩子检查工具显然是不够的,建立vcxproj项目,即使它们不包含任何C ++ code(仅pre和后生成步骤)。添加的Visual C ++编译器选项,并充分选择智能感知和引用程序集复选框,安装必要的文件和设置。我不知道,如果两者都是必要的,但该组合确实为我工作。

The Microsoft Windows SDK 7.1 has several installation options. Having only the ".NET Development" child "Tools" checked is apparently not enough to build vcxproj projects, even if they don't include any C++ code (only pre- and post-build steps). Adding the "Visual C++ compilers" option and fully selecting the "Intellisense and Reference Assemblies" checkbox installs the necessary files and settings. I'm not sure if both are necessary, but that combination did work for me.

这篇关于如何建立一个VS2010文件项目(vcxproj)与TFS生成(无VS 2010)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 05:29
查看更多