Building an ASP.NET solution from the command line?

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

+5
source share
6 answers

Try this in the .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"
+4
source

Look at the devenv.exe / Build switch , you give it a solution file for the build, for example.

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

For more complex build requirements, check out MSBuild .

+1
source

, MSBuild msbuild project:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<ItemGroup>
  <Solutions Include="*.sln" />
</ItemGroup>

<Target Name="Build"   >
  <MSBuild BuildInParallel="true" Projects="@(Solutions)" RebaseOutputs="true"  />
</Target>

msbuild projectname .proj .

, (, -, zip , !, ), .

+1
+1

,

msbuild mysolution.sln

MSBuild Microsoft.NET Windows.

You can also precompile your website. Instructions for this are located on MSDN here . If you are using the node web deployment project (in detail below), the deployment will occur automatically when you run msbuildin the solution file.

0
source

All Articles