Share via

How to handle .NET Runtime updates with running applications

Nico-87 0 Reputation points
2026-01-27T11:00:31.7766667+00:00

Last friday we faced an issue with our application where a user was unable to save their data and got a missing file exception.

We believe this might be related to the update of the .NET 8 Runtimes, while our (.NET8) application was running.

  1. The User opened our software on Friday 23rd January at 0800. application is then linked to 8.0.22.
  2. IT security issued a .NET update on the 23rd of January to update .NET 8 from 8.0.22 to 8.0.23.
  3. This update was applied on the users machine while our application was running using 8.0.22 like around 0900
  4. The User pressed Save the first time around 1000.
  5. Only on save it first uses ZipOutputStream and System.Security.Cryptography.Algorithms.dll
  6. Application tries to load it from the 8.0.22 folder which is removed by the security update.

Result: Save fails

Is it correct that the .NET 8 Runtime installer can update the runtime to a newer version, while other .NET 8 apps are still running?

If so, is there a way to prevent this? Or for our application to handle this scenario better?

Looking forward to your advise.

Developer technologies | .NET | .NET Runtime
0 comments No comments

3 answers

Sort by: Most helpful
  1. Jack Dang (WICLOUD CORPORATION) 16,115 Reputation points Microsoft External Staff Moderator
    2026-01-28T09:25:12.2266667+00:00

    Hi @Nico-87 ,

    Thanks for reaching out.

    In practice, the most reliable approach is to restart the app after an update or use a self-contained deployment. This ensures all required DLLs are available and avoids runtime errors.

    .NET runtime patch updates can replace older patch folders while an app is running. When your app tried to load System.Security.Cryptography.Algorithms.dll from 8.0.22, that folder had already been removed by the 8.0.23 update.

    To prevent or mitigate this:

    1. Apply .NET servicing updates only when affected applications are stopped or during maintenance windows to avoid missing-file errors. (https://dori-uw-1.kuma-moon.com/en-us/dotnet/core/releases-and-support)
    2. Catch failures when loading runtime assemblies and prompt users to restart the app. This ensures the process binds to the new runtime instead of failing.
    3. Ship critical runtime dependencies with your app so it doesn’t rely on the shared system runtime. In a self-contained deployment, your app includes all required .NET files and is isolated from system runtime updates. (https://dori-uw-1.kuma-moon.com/en-us/dotnet/core/deploying/)

    Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.

    1 person found this answer helpful.

  2. Pooja Bhati 0 Reputation points
    2026-02-10T13:08:45.4533333+00:00

    This issue can occur if the .NET Runtime is updated while the application is actively running, especially if the update replaces or modifies runtime files being used by the application.

    To handle .NET Runtime updates safely, follow these best practices:

    1. Avoid updating the runtime while the application is running. Always stop the application or service before applying runtime updates.
    2. Restart the application after the runtime update to ensure it loads the updated runtime properly.
    3. Use self-contained deployment if you want your application to use a specific runtime version and avoid dependency on system runtime updates.
    4. In production environments, schedule maintenance windows for runtime updates to prevent unexpected issues.
    5. Monitor application logs and verify runtime version compatibility after updates.

    Following these steps ensures stability and prevents missing file or runtime-related exceptions during updates.

    0 comments No comments

  3. Bruce (SqlWork.com) 83,666 Reputation points
    2026-01-27T17:16:46.85+00:00

    All .net core runtimes, even patched versions are installed side by side, so updates can be applied while applications are running. But if you configure the updates to delete the previous patch, then running apps should be stopped before updates.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.