VB.net应用程序保留以前的版本 [英] VB.net application is keeping previous versions

查看:66
本文介绍了VB.net应用程序保留以前的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在发布的可视化基础项目,每次都会增加版本号。

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.

推荐答案

尝试发布时更新所需的最低版本应用程序
转到应用程序属性->发布->更新...:

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

如果您要自动执行此操作并强制用户只能使用最新版本,则可以使用 MSBuild

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. 在Visual Studio中,右键单击项目,然后单击卸载项目

右键单击项目,然后单击编辑

Right click on the project and click on Edit

将以下代码复制并粘贴到close < / Project> 元素之前

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>




  • 保存并重新加载项目

  • Save and Reload the project

    这篇关于VB.net应用程序保留以前的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆