VB.net application is keeping previous versions

I have a visual basic project that is being published and increments the version number each time.

When I install a new version, it opens but as soon as the application restarts, it seems to revert back to the previous version and I cannot work out why.

Add Comment
3 Answer(s)

Try to update a minimum version required when you publish the application go to application proprties -> publish -> Updates…:

enter image description here

If you want to do this automatically and force the user to work on latest version only, you can update the vbproj file with MSBuild

  1. In Visual Studio, right click on the project and click on Unload Project

  2. Right click on the project and click on Edit

  3. Copy and Paste the following code before the close </Project> element

    <Target Name="AutoSetMinimumRequiredVersion" BeforeTargets="GenerateDeploymentManifest">   <FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)">     <Output PropertyName="MinimumRequiredVersion" TaskParameter="OutputVersion"  />   </FormatVersion>   <FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)">     <Output PropertyName="_DeploymentBuiltMinimumRequiredVersion" TaskParameter="OutputVersion"  />   </FormatVersion> </Target> 
  4. Save and Reload the project

Add Comment

The whole point of a Click-once app is that it is uploaded to some URL where clients can fetch the latest version of it, automatically install it, and check for updates later. You can specify these under Publish in your project settings.

Specify foler location and installation URL

Once the correct data is provided here, you can publish your app, and have your users install it from the Installation Folder URL.

Under Updates (button in the pic above), you can specify whether the app should be available offline, what the minimum required version should be (make sure to update this to force updates!), and when the app should check for updates.

If you set this up correctly, then the application should update itself whenever a user starts it on a client, and a new version is available on the server.

PS: The full URL to download your application should then be as follows:

http://publicaddress.to.that.folder/YorApp/Your.Project.Name.application 

Here Your.Project.Name is the name of your project in Visual Studio, and .application is the file extention for the installation file.

Add Comment

Try to Clean and Rebuild the Project.

Answered on July 16, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.