old app version is started after file is replaced

teamtecture 1 Reputation point
2020-10-14T09:41:50.503+00:00

We are developing a WinForms desktop application. In order to update our application, we replace the exe-file. At this point the application is running by several users. If a user restarts the application (on the same or another server in network), sometimes the old version gets started, not the current exe-file. We observe that this kind of caching ends when all instances of the application on one server are closed.

What kind of caching is this? How we could force this caching to update without closing all instances?

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,838 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,616 Reputation points
    2020-10-15T06:00:35.803+00:00

    Hi teamtecture,
    I suggest you update your application with ClickOnce.
    First, you can use ClickOnce to publish your application, and then you can configure the application to check for updates automatically before the application starts, or at set intervals after the application starts.
    Right click your project name ->choose Properties-> Publish, then you can publish your application by following this document.
    About updates for a ClickOnce application, please follow this document.
    Here is also a similar thread you can refer to.
    Best Regards,
    Daniel Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.