Publish an ASP.NET MVC 2 Application from the Command Line and Web.config Transforms

Good afternoon!

I found this solution here: VS2010 Windows Web Publishing Publishing Version for File System Deployment

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe .\MyProject.csproj /p:Configuration=Release;DeployOnBuild=True;PackageAsSingleFile=False;outdir=c:\_OuputDir\ 

But it seems that Web.config conversions are not being executed.

Maybe there is a better \ cleaner way to duplicate the VS2010 Publish Web dialog?

Update: The answer that is marked is the shortest command line for publishing I have found so far. Web.config transformations are applied, but connection strings are handled differently, here description \ workaound

+1
asp.net-mvc deployment
Dec 07 '10 at 21:38
source share
3 answers

This might work (what I found here ):

 msbuild solution.sln /p:Configuration=Release;DeployOnBuild=true;DeployTarget=Package;_PackageTempDir=..\publish 

However, he gave me the following error when I tried to run it (which I am still fixing):

C: \ [path] \ [config] \ csautoparameterize \ original \ web.config (40): ASPCONFIG error: Failed to use the section registered as allowDefinition = 'MachineToApplication' that exceeds the application level. This error can be caused by the fact that the virtual directory is not configured as an application in IIS.

+1
Mar 01 '11 at 12:10
source share

Excerpt from: http://ashwaniksharma.spaces.live.com/Blog/cns!AD160FFA5932F17E!206.entry

 MSBuild .\MyProject.csproj /t:TransformWebConfig;/p:Configuration=Release;DeployOnBuild=True;PackageAsSingleFile=False;outdir=c:\_OuputDir\ 
+1
Feb 24 '11 at 1:01
source share

My solution for CCNET with Web.config conversion:

 <tasks> <msbuild> <executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable> <workingDirectory>E:\VersionesCC\Trunk_4\SBatz\Gertakariak_Orokorrak\GertakariakMS\Web</workingDirectory> <projectFile>GertakariakMSWeb2.vbproj</projectFile> <targets>Build</targets> <timeout>600</timeout> <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger> <buildArgs> /noconsolelogger /p:Configuration=Release /v:diag /p:DeployOnBuild=true /p:AutoParameterizationWebConfigConnectionStrings=false /p:DeployTarget=Package /p:_PackageTempDir=E:\Aplicaciones\GertakariakMS2\Web </buildArgs> </msbuild> </tasks> 
+1
May 08 '13 at 8:25 am
source share



All Articles