I want to automate the build process for my C# solutions. How can I build C# solutions from the command line so that I don't have to deal with dependencies manually?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
msbuild YourSolution.sln
For solutions you can use:
devenv /build Release Solution.sln
or
devenv /build Debug Solution.sln
Visual Studio project and solution files are also MSBuild build files.
You can simply run MSBuild against the solution/project file and it will build:
Personally I'm a huge fan of Rake (yeah - I heard you when you said your c# solution)
Check it out: http://www.lostechies.com/blogs/derickbailey/archive/2009/09/23/albacore-a-suite-of-rake-build-tasks-for-net-solutions.aspx
Have fun - it made life a lot better for me!
you can use the c# (
csc.exe
) compiler directly:Command-line building with csc.exe
if you open a visual studio command prompt from your start menu - then you can call MSBuild and give that either the .sln file or a specific .csproj file in order to build what you need
alternatively you can create a custom MSBuild file that takes care of the tasks.
one tip: make sure the version of MSBuild that you use is applicable to the target framework or tools version of the project
i.e. if you try and build a solution that was created in vs2010 with msbuild 3.5 then it will not recognise the 4.0 toolset of the project