I have been looking around the various NAnt vs MSBuild threads here on Stack Overflow and so far I understand they are both Build Tools. They make use of XML to structure how the build takes place. Additionally one is more suited to VS solutions and projects while the other is more of a flexible scripted approach (you can do more with it).

What I am puzzled about is:

What actually compiles the source, does MSBuild call a compiler? Does NAnt call MSBuild to call a compiler?

Edit:

Will NAnt call MSBuild or compile a C# project via csc directly?

有帮助吗?

解决方案

csproj file in Visual Studio import Microsoft.CSharp.targets which is an MSbuild file which contains the CoreCompile target to do the compilation. This target uses the CSC task to do the actual compilation, which itself call csc.exe.

You can find the Microsoft.CSharp.targets file in the framework root directory e.g. C:\Windows\Microsoft.NET\Framework\version\

NAnt has a csc target, so I assume it works in a similar way.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top