Publish ASP.NET MVC 2 application from command line and Web.config transformations

前端 未结 3 1723
北荒
北荒 2021-01-16 00:06

Good day!

I\'ve found this solution here: VS2010 Web Publish command line version of File System deploy

C:\\Windows\\Microsoft.NET\\Framework\\v4.0.3         


        
相关标签:
3条回答
  • 2021-01-16 00:29

    My solution for CCNET with the Web.config transformation:

    <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>
    
    0 讨论(0)
  • 2021-01-16 00:35

    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\
    
    0 讨论(0)
  • 2021-01-16 00:56

    This might work (which I found here):

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

    However, it gave me the following error when I tried to run it (which I'm still working to fix):

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

    0 讨论(0)
提交回复
热议问题