Solutions files and non-MS build systems
Visual Studio 2008 uses its own solution file format, and different build systems like NAnt (and even some comp开发者_运维问答lex MSBuild cases) use their own. How do you keep them synchronized? Are there any best practices about doing so? Any automated scripts, plugins...?
Is it viable not to build projects under VS and use only external build system?
Wait, your doing it wrong;) VS uses SLN file format to determine the VS solution settings (xml), nAnt is a build system uses BUILD file format (xml) to determine the build tasks, it's not a solution. MSbuild uses PROJ files (xml) to determine build process and tasks. What do you mean by "synchronized"? In my case if there are some major changes in the project I've just edit those build files (we're using nAnt, msbuild, etc) and add a proper change.
Using NAnt to manage your build dependencies and projects is indeed troublesome since you need to maintain the dependencies in both the build script and the solution file. The usual thing is simply to ensure developers update the build scripts as they add/remove projects to the solutions and make sure you have sufficient automated smoke tests that you'll spot when expected pieces haven't been added.
It wouldn't be difficult to write a tool to parse the solution file and work out the project dependencies, but I'm not aware of any that already exist.
Note that MSBuild is what VS uses internally and it can accept a solution file as an argument if you run it externally, it will generate an equivalent MSBuild script from the .sln and execute it (you'll see a .sln.cache file appear).
Paolo's answer points to the right direction: Visual Studio creates .sln files, MSBuild can process these solution files and with NAntContrib's msbuild
task you can call MSBuild from NAnt scripts easily.
精彩评论