Automatically publish web application on build from Visual Studio 2015

后端 未结 3 443
感情败类
感情败类 2021-01-12 11:07

Is there any way to automatically have a web application published using a pre-created publish profile on successful build? I don\'t want to have to click the publish icon,

3条回答
  •  甜味超标
    2021-01-12 11:54

    Rami's solution works, but it requires another "Build" pass. While this won't actually recompile, it will still cause unnecessary delay if your solution is large.

    You can't trigger the web publish via DeployOnBuild as that's automatically disabled when building from Visual Studio.

    You can, however, trigger the process as part of the same MSBuild invocation via some MSBuild trickery:

    
    
      Local
    
    

    And also:

    
    
      true
    
      
        $(AutoPublishDependsOn);
        WebPublish
      
    
    
    
    
    

    If you're finding that your publish project isn't being built when you make content changes, add the following:

    
    
      true
    
    

提交回复
热议问题