MSBuild doesn't respect PublishUrl property for my ClickOnce app

后端 未结 4 1096
余生分开走
余生分开走 2020-12-08 14:46

I\'m trying to make a batch file to publish the few ClickOnce application we have in one click. I\'m using msbuild for that, and as an example the below command line shows h

4条回答
  •  轮回少年
    2020-12-08 15:40

    Some features are done by Visual-Studio and not by the MSBuild-script. So the click-once-deployment behaves differently when it's executed from the command-line.

    • The ApplicationRevision isn't increased with every build. This works only when is exectued from Visual Studio
    • In in somecases, the PublishUrl isn't used. Quote from MSDN:

      For example, you could set the PublishURL to an FTP path and set the InstallURL to a Web URL. In this case, the PublishURL is only used in the IDE to transfer the files, but not used in the command-line builds. Finally, you can use UpdateUrl if you want to publish a ClickOnce application that updates itself from a separate location from which it is installed.

    I've created a special MSBuild-file which does this things. It runs the publish-target and copies then the files to the right location.

    An example of the build-file, as requested by alhambraeidos. It basically runs the regular VisualStudio-build and then copies the click-once data to the real release folder. Note that removed some project-specific stuff, so it's maybe broken. Furthermore it doesn't increase the build-number. Thats done by our Continues-Build-Server:

    
    
        
            
            ..\YourProjectFolder
            $(ProjLocation)\bin\Release
            $(ProjLocationReleaseDir)\app.publish
            
            D:\server\releases\
        
    
    
        
            
               
    
    
            
                
                
            
            
                  
            
        
           
            
            
               
    
    

提交回复
热议问题