MSBuild 2010 - how to publish web app to a specific location (nant)?

后端 未结 3 1463
清酒与你
清酒与你 2020-12-24 08:26

I\'m trying to get MSBuild 2010 to publish a web app to a specific location. I can get it to publish the deployment package to a particular path, but the deployment package

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-24 08:52

    If you are using a VS2010 web application (as opposed to a web site project), consider setting up the Package/Publish Web settings in your project and building the 'Project' target in your nant script.

    Lots of juicy msdeploy goodness and background here: http://www.hanselman.com/blog/WebDeploymentMadeAwesomeIfYoureUsingXCopyYoureDoingItWrong.aspx

    In my nant scripts, I run the following msbuild commands:

        
            
                
                
                
                
            
        
    
    ...
    
        
            
                
                
                
                
                
            
        
    

    My basename nant variable gives the name of both the VS solution file (.sln) and the project file (.csproj) for the web application. I happen to prefer the zip-file deployment as shown in my project settings:

    Sample Package Settings for Deployment of Web Application

    There is one additional quirk. If you install MSDeploy version 2.0 on the target machine, the .deploy.cmd file must be edited to change the MSDeploy version number as follows:

    Change

      for /F "usebackq tokens=2*" %%i  in (`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1" /v InstallPath`) do (
    

    To

      for /F "usebackq tokens=2*" %%i  in (`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\2" /v InstallPath`) do (
    

提交回复
热议问题