Problems using MsBuild using command line for Publish Click Once

前端 未结 3 1340
慢半拍i
慢半拍i 2020-12-05 07:38

I have Windows application in csproj in my solution, and I want generate Publish using command line (bat, cmd).

My script is (I put \\r\\n for better re

3条回答
  •  孤城傲影
    2020-12-05 08:36

    Take a look at this Stack Overflow question. Basically the PublishUrl property is ignored when running ClickOnce from the command line. But you can easily add the behaviour with an additional MSBuild-task.

    I've created an additional MSBuild-File, for example a build.csproj. This contains a publish-task. This task first invokes the regular MS-Build of the target-project. Afterwards it copies the result to the publish-directory. Now I invoke the 'build.csproj' instead of the reguar project-file from the command-line:

        
        
          
            
            MyExampleProject 
            
            Configuration=Release 
            
            .\bin\Release\app.publish 
            
            \\TargetServer\deployments 
          
          
            
            
            
            
            
              
              
            
            
            
            
          
          
            
            
          
        
    

提交回复
热议问题