Search code examples
c#wpfversion

How can I control the WPF exe file version


I build a WPF solution and after compile, I got a exe file in the bin folder. I copied this exe file into a shared folder for a few users to use it. But some users will copy it to their own PC's c: drive to use.

Now I have a new version of the WPF solution. I copied the new version of exe file to replace the one in the shared folder. But I can't replace the ones in user's own PC. How can I make sure the old version exe tool doesn't work. And users have to use the new version?


Solution

  • How can I make sure the old version exe tool doesn't work. And users have to use the new version?

    You can't unless you have written code in the application to ask some remote server for the last valid version number and shut it down if the current version doesn't matches this one.

    What you really need is a better way to deploy your app. I would recommend you to look into using ClickOnce. It should be easy to learn and use and require no major changes to your source code.

    Another slightly more advanced and sophisticated way technology to deploy your apps on Windows 10 would be to use MSIX.