Fast Re-build C# app under Windows 7
Need to recompile my project (not large) under Windows 7 without setting up Visual Studio. Is there any method to do that with minimum setup procedure. It's C# app, using System.Net.Sockets and some others from my other projects.
Should I set up whole VS to recompile just little code app? like batch build..
Or... is there any cloud/public servers with pre-installed different Operati开发者_运维技巧onal Systems with Visual Studio, where I could upload my project and just re-build it under all platforms at once?
I use this batch script to compile my C# applications. Just pass in the solution name without the .sln extension
if exist %SYSTEMROOT%\Microsoft.NET\Framework\v3.5 set MSBUILDPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v3.5
if exist %SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319 set MSBUILDPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
set MSBUILD=%MSBUILDPATH%\msbuild.exe
%MSBUILD% /nologo /m /p:BuildInParallel=true /p:Configuration=Release /p:Platform="Any CPU" "%1.sln"
Do you just want to use studio to compile without running the GUI? If so, you have at lot less work to do. Use devenv.exe.
http://msdn.microsoft.com/en-us/library/xee0c8y7%28v=vs.80%29.aspx
This should work for you:
csc /r:Reference1.DLL /r:Reference2.DLL /r:Reference3.DLL Main.cs...other cs
/r: pass refereences of your project after, pass cs files separated by space
In order to run this in CMD o PowerShell, you may need to run *vcvars32.bat, which you can copy from machine where you have VS installed, or just, before inserting command, set complete path to csc.exe*
Regards.
With the .net Framework installed, you can just use msbuild or csc.exe.
Build project on commandline with msbuild.exe (comes with the framework).
No need to use devenv (which is vs) or csc (which requires you to specify dependencies etc.)
精彩评论