We have an Excel plugin as part of our Visual Studio solution. The plugin is built once and then deployed out to different environments (dev, uat, prod) as part of our CI/CD process.
During the deploys we apply an app config transform to update the Excel plugin config with the correct environmental config.
As such, the manifest and VSTO needs resigning. I've been through a number of SO posts (Use mage.exe to create a ClickOnce deployment manifest for *.deploy files, Resign manifest of click-once application change from 4.0 to 4.5, Resign Clickonce manifest using mage.exe etc.) and MSDN posts and cannot work out the correct way to call mage.exe
for this to work.
I've tried mage.exe -update ...
, mage.exe -sign ...
and a couple of other combinations that all result in broker or invalid manifests when I try to launch the VSTO e.g.
C:\Tools\mage.exe -update "$CodeBasePath\MyCompany.vsto" -certFile "$CertFile" -password "$CertPassword" -appManifest "$AppManifestPath"
Does anything know the correct order of signing and flags to use with mage.exe
when re-signing a VSTO?
This tool is automatically installed with Visual Studio. To run the tool, use Visual Studio Developer Command Prompt or Visual Studio Developer PowerShell. Two versions of Mage.exe and MageUI.exe are included with Visual Studio. To see version information, run MageUI.exe, select Help, and select About.
A deployment manifest is an XML file that describes the deployment settings of an Office solution and identifies the current application version. The Office development in Visual Studio uses the ClickOnce deployment manifest schema defined in the ClickOnce deployment manifest reference.
before updating the VSTO file you need to first update the application manifest.
mage -update yourFile.dll.manifest -CertFile certificate.pfx -Password password
Then you need to update the VSTO with the application manifest you already updated.
mage -update yourFile.vsto -appmanifest yourFile.dll.manifest -CertFile certificate.pfx -Password password
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With