有没有任何MSBuild的替代品? [英] Is there any MSBuild alternative?
问题描述
**我是一名训练有素的学生,对C#的经验很少。
我们公司正在使用T4模板(C#VS2010)开发一个解决方案。
生成的文件不能在MSBuild下编译,因为它是依赖于VS的。
我的任务是找到一个工具或一个库或一个.dll文件或SDK或任何东西,可以取代VS在构建时间。其他明智的,我必须修改生成的代码是VS独立我selef,我认为是一个diffugult任务为我。
code samble:
**I'm an under training student with so few experience of C#. Our company is developing a solution using T4 templates (C# VS2010). The generated files can't be compiled under MSBuild because it is VS dependent. My task is to find a tool or a library or a .dll file or SDK or any thing that can replace VS in building time. Other wise I have to modify the generated code to be VS independent my selef, which I think is a diffucult task for me. code samble:
Project GetProjectContainingT4File(DTE dte) {
// Find the .tt file's ProjectItem
ProjectItem projectItem = dte.Solution.FindProjectItem(Host.TemplateFile);
// If the .tt file is not opened, open it
if (projectItem.Document == null)
projectItem.Open(Constants.vsViewKindCode);
if (AlwaysKeepTemplateDirty) {
// Mark the .tt file as unsaved. This way it will be saved and update itself next time the
// project is built. Basically, it keeps marking itself as unsaved to make the next build work.
// Note: this is certainly hacky, but is the best I could come up with so far.
projectItem.Document.Saved = false;
}
return projectItem.ContainingProject;
}
我会感谢您的帮助**
I would appreciat your help.**
推荐答案
限制
生成的文件可以'在MSBuild下编译,因为它是VS依赖
The generated files can't be compiled under MSBuild because it is VS dependent
看起来很奇怪。为什么要针对.NET环境,但希望您的构建环境是MS独立的?当然,你至少需要一个C#编译器。
seems very odd. Why would you target the .NET environment but want your build environment to be MS independent? Surely you at least need a C# compiler.
如果你真的想使用除了MSBuild之外的东西,有很多选择,如Mono的 Microsoft.Build 或甚至 Make for Windows 。
If you really want to use something besides MSBuild, there are a number of alternatives such as Mono's Microsoft.Build or even Make for Windows.
这篇关于有没有任何MSBuild的替代品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!