WPF COMException Crashes Application At Startup (Started Today) WPF COMException Crashes Application At Startup (Started Today) wpf wpf

WPF COMException Crashes Application At Startup (Started Today)


Update: Microsoft has now fixed this problem in a manual update (as noted by Jürgen), personally I will stick with the workaround until the fix is in the automatic update because it would be a lot of work to make every user install a manual update.


This is obviously a bug in .Net 4.7 that affects Windows 7 and 8/8.1 systems that have a touch input device. Therefore one can hope that Microsoft addresses this in a future update. Meanwhile the only way to retain full functionality is by uninstalling and hiding the update.

Other option is disabling the stylys and touch support either in app.config (like in your link) or in the code if the app is compiled with 4.6 or newer. You didn't specify why that is not ideal but I assume those features are needed? Notice that the disabling doesn't mean that every app is unusable with touch devices, but rather that they only use features that are accessible with a mouse. Update: Apparently touch device users without a mouse will have trouble using UI that requires scrolling.

Here's the code examples for those who come here seeking quick fix:

In App.config (works with apps compiled with any framework version)

<configuration>  <runtime>    <AppContextSwitchOverrides value="Switch.System.Windows.Input.Stylus.DisableStylusAndTouchSupport=true" />  </runtime></configuration>

In code (when compiled with .Net Framework >= 4.6)

protected override void OnStartup(StartupEventArgs e){    AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.DisableStylusAndTouchSupport", true);    base.OnStartup(e);}