开发者

MsBuild task GenerateDeploymentManifest.CreateDesktopShortcut does not work

开发者 https://www.devze.com 2023-02-03 08:37 出处:网络
In automating a ClickOnce publishing procedure we are using Mage to generate the application manifest and the MsBuild GenerateDeploymentManifest task.

In automating a ClickOnce publishing procedure we are using Mage to generate the application manifest and the MsBuild GenerateDeploymentManifest task.

<GenerateDeploymentManifest AssemblyName="App.exe.application"
                                AssemblyVersion="$(AppVersion)"
                                Product="Application"
                                Install="true"
                                UpdateEnabled="true"
                                UpdateMode="Foreground"
                                OutputManifest="$(PrepareFolder)\App.exe.application"
                                MapFileExtens开发者_开发问答ions="true"
                                EntryPoint="@(RelativeApplicationManifestFile)"
                                CreateDesktopShortcut="true"
                                MinimumRequiredVersion="$(AppVersion)"
                                />

But the CreateDesktopShortcut has no effect and does not create the desired tag in the deployment manifest file.

Getting this:

<deployment install="true" 
            mapFileExtensions="true" 
            minimumRequiredVersion="2.19.13.0">

instead of

<deployment install="true" 
            mapFileExtensions="true" 
            minimumRequiredVersion="2.19.13.0" 
            co.v1:createDesktopShortcut="true">

Am I missing something?


You need to add the TargetFrameworkVersion attribute to the GenerateDeploymentManifest task. It should be "3.5" or "4.0" depending on what framework version you are building for. The task default is "2.0" which is why you have to set it explicitly.

There is a check in the task that this must be set to "3.5" or greater in order for the CreateDesktopShortcut to actually generate anything.

<GenerateDeploymentManifest AssemblyName="App.exe.application"
                                AssemblyVersion="$(AppVersion)"
                                Product="Application"
                                Install="true"
                                UpdateEnabled="true"
                                UpdateMode="Foreground"
                                OutputManifest="$(PrepareFolder)\App.exe.application"
                                MapFileExtensions="true"
                                EntryPoint="@(RelativeApplicationManifestFile)"
                                CreateDesktopShortcut="true"
                                TargetFrameworkVersion="3.5"
                                MinimumRequiredVersion="$(AppVersion)"
                                />
0

精彩评论

暂无评论...
验证码 换一张
取 消