question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WPF app crashed because the .NET runtime was upgraded by Microsoft Update.

See original GitHub issue

Description

When our app is running(the .NET runtime version is 6.0.10), the .NET runtime was upgraded to 6.0.11 by the Microsoft Update, our product would crash.

Reproduction Steps

The issue can be reproduced with the following steps:

  1. Turn on the following setting: Windows Update -> Advanced options Enable the following item:

Receive updates for other Microsoft products.

  1. Create a simple C#/WPF project with VS2019 or 2022. Since the latest .NET runtime is 6.0.11, so please ensure the used .NET runtime is 6.0.10 or lower version.
  2. Build and run it.
  3. During the app running, run “check for update” from the system Settings. You will see the .NET runtime is upgraded to 6.0.11.
  4. After the upgrade completes, check the app state.
  5. If it doesn’t get crashed, close the app manually. ==> You will see the app crashed.

Expected behavior

The app shouldn’t crash either during running or when exiting.

Actual behavior

The app crashes during running or when exiting.

Per debugging the dump file in VS IDE, the exception message was: System.DllNotFoundException: 'Unable to load DLL 'vcruntime140_cor3.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)'

Regression?

No

Known Workarounds

No workaround.

Configuration

I tested .NET runtime 6.0.9 and 6.0.10 with the simple C#/WPF application in VS2019 and VS2022.

Other information

No response

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
springy76commented, Feb 24, 2023

Each time VS-Installer updates the .NET SDK then all already running .NET apps (for example LINQPad) crash at the latest when closing them. (and the VS updater only updates .NET every 2 or 3 times, never telling before whether it will do that).

1reaction
Bo-Liu-BLcommented, Dec 2, 2022

I had this problem a long time ago. I solved this problem by self-contained.

Thank you, Lindexi. We couldn’t do like that in our product for the sake of the future upgrade of the .NET runtime. For example, if .NET runtime released important updates such as security related, if we use the self-contained way, we need to release the new version of our product. If we don’t use the self-contained way which is used by our product currently, users can upgrade the .NET runtime in their environments then continue to use our existing release product.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WPF Apps crash on Windows 10/11 after ...
My company develops .NET WPF apps (32-bit, targeting .NET Framework 4.7.2, and 4.5 for one of the old ones) written in C# using...
Read more >
Issue with KB5017262 & KB5017270 cause WPF ...
our customers reporting that since the upgrade of the above KB, our WPF application crash with the below error: System.Reflection.
Read more >
WPF app crash when submit to Microsoft Store
Launch the product. Notice that the product crashes and displays an error message(System.ApplicationException: Could not resolve target runtime ...
Read more >
WPF application crash on start up (64 bit)
running 32 WPF bit applications works fine, only 64 bit is crashing. trying to repair .net framework did not work.
Read more >
WPF Enterprise App crashes on Windows 10/11 after ...
WPF Enterprise App crashes on Windows 10/11 after Windows Updates installed - "StoryFragments part failed to load" Our enterprise app (32/64 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found