简体   繁体   中英

Outlook c# VSTO Add-in - Version number won't change from 1.0.0.0 - Visual Studio 2015

I'm writing a simply c# add-in in VS2015 for Outlook 2016. My project has an AssemblyInfo.cs file and I update the AssemblyVersion and AssemblyFileVersion in there before building the project. This updates the version of the.dll file which is built, but the version number of the VSTO itself remains at 1.0.0.0. This means that when I try to install a new version of the VSTO, I'm told that I already have the latest version. I have to uninstall my add-in from Add/Remove Programs (where it shows as v1.0.0.0) before I can re-install a later build on my add-in.

How do I update the version number of the actual VSTO please? Ideally would be nice for all three version numbers (DLL Assembly and File as well as VSTO) to stay in synch and increment each time I produce a new build. I've done lots of hunting around and googling but cannot find the answer.

Thanks, Tony

Update:
You can change the version of your vsto addin at Project -> Properties -> Publish -> Publish Version


If you want to update the version of your VSTO and have already built, open the vsto manifest using a file editor, which is supposed to end with .vsto .

After that, change the version property of assemblyIdentity at the very top of your file. It should look like below:

<assemblyIdentity name="YourProjectName.vsto" version="1.0.1.0" publicKeyToken="************" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />

After changing the manifest, you have to resign it with your code-signing certificate ( .pfx ).
Here is a document from Microsoft shows how to do it.


If you don't have a code-signing certificate, consider to buy one or make a self-signed certificate.

One possible way to do this (powershell):

New-SelfSignedCertificate -DnsName email@yourdomain.com -Type CodeSigning -CertStoreLocation cert:\CurrentUser\My

Or have a look of this answer on stackoverflow: How do I create a self-signed certificate for code signing .

Hope this would help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM