Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building a ASP.NET solution from command-line?

How can I build an ASP.NET web application from the command line?

like image 350
Kman Avatar asked Dec 11 '09 09:12

Kman


2 Answers

Try this in a .bat file, replace v4.0.30319 with the appropriate version:

CD C:\Windows\Microsoft.NET\Framework\v4.0.30319 
msbuild "C:\inetpub\wwwroot\MyWebSite.sln"
like image 200
James Lawruk Avatar answered Sep 29 '22 23:09

James Lawruk


Take a look at the devenv.exe /Build switch, you give it a solution file to build, e.g.

devenv.exe "C:\Documents and Settings\someuser\MySolution.sln" /build DEBUG

If you have more complex build requirements then look into MSBuild.

like image 38
Chris Fulstow Avatar answered Sep 30 '22 00:09

Chris Fulstow