Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
292 views
in Technique[技术] by (71.8m points)

c# - WinForms Setup project installation executes the previous version

After updating WinForms desktop application, Setup project uninstall successfully deletes installation path by C:Program Files (x86)myProject, but new, in advance Clean, Rebuild and Build installation executes the previous version of the code, which was actual at the time of adding Setup project to solution.

What I have to do:

  1. In Configuration manager from Build menu and column check "main Project" and the "Setup project" for both "Debug" and "Release" versions.

  2. In Solution Explorer my project properties Application tab Assembly Information change the version of the project for both Assembly Version and File Version with same versioning values.

  3. Change the version in the Setup project properties Version value with the same version.

I'm not sure if I've missed something to fix issue. Seems like correct way to not change version manually is auto increment of major, minor and patch versioning for Setup project, according this answers How to have an auto incrementing version number (Visual Studio)? and Can I automatically increment the file build version when using Visual Studio?

but if I'm doing this manually, if there is a 4 digits:

Assembly Version: 1, 0, 0, 0
File Version:     1, 0, 0, 0

enter image description here

and Setup project is a 3:

Version: 1, 0, 0

enter image description here

How set properly, if update is:

Assembly Version: 1, 0, 0, 1
File Version:     1, 0, 0, 1

Or if I should miss 4th digit, what will be correct for Configuration manager to avoid previous code with executable:

Assembly Version: 1, 0, 1, 0
File Version:     1, 0, 1, 0

and:

 Version: 1, 0, 1

In my case with this task I found useful following links:

AssemblyVersionAttribute Class with AssemblyVersionAttribute(String) Constructor and in addition What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion? with The specified version string contains wildcards, which are not compatible with determinism and How to: Specify build events (C#)

question from:https://stackoverflow.com/questions/66067879/winforms-setup-project-installation-executes-the-previous-version

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In the properties of the Setup project, you must also increase the Version property. You can do this in the properties window. Then you will be asked whether you want to change the product code. Confirm.

Make sure the file versions of all projects have been incremented.

Then rebuild the setup project.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...