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"
MapFileExtensions="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)"
/>