Hello,
Our company developed a WPF application based on .NET 4.0 for a customer and it was released back in 2015. The application has been running without any problems. However, we are now receiving more and more crash reports where the application crashes with the above exception on startup.
Here is the stack trace:
System.Windows.Markup.XamlParseException: The invocation of the constructor on type 'App.ViewModel.Shell.ShellViewModelLocator' that matches the specified binding constraints threw an exception.
PresentationFramework
System.Object Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
at System.Windows.Application.DoStartup()
at System.Windows.Application.<.ctor>b__1_0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Inner Exception:
System.InvalidOperationException: Cannot perform this operation while dispatcher processing is suspended.
WindowsBase
Void PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at App.ViewModel.Device.DeviceViewModel.ForceCommandInvalidation() in C:\Users\...\App\ViewModel\Device\DeviceViewModel.vb:line 550
at App.ViewModel.Device.DeviceViewModel.set_CanConnectInternal(Boolean value) in C:\Users\...\App\ViewModel\Device\DeviceViewModel.vb:line 88
at App.ViewModel.Device.DeviceViewModel.RefreshCanConnectAndConnectCommand() in C:\Users\...\App\ViewModel\Device\DeviceViewModel.vb:line 337
at App.ViewModel.Device.DeviceViewModel..ctor(MultimeterDeviceBase device) in C:\Users\...\App\ViewModel\Device\DeviceViewModel.vb:line 199
at App.ViewModel.InstanceInitializer.AddRunTimeDevice() in C:\Users\...\App\ViewModel\InstanceInitializer.vb:line 71
at App.ViewModel.InstanceInitializer.InitInstances() in C:\Users\...\App\ViewModel\InstanceInitializer.vb:line 35
at App.ViewModel.GenericViewModelLocator`1.CreateMissingInstance() in C:\Users\...\App\ViewModel\GenericViewModelLocator.vb:line 27
at App.ViewModel.GenericViewModelLocator`1..ctor() in C:\Users\...\App\ViewModel\GenericViewModelLocator.vb:line 16
at App.ViewModel.Shell.ShellViewModelLocator..ctor()
Over the years, we have continued to develop the software and release newer versions. Also, in one of the last versions we raised the .NET Framework. These new versions do not have this problem and run without any problems.
After some trial and error, I was able to pinpoint the cause to a specific Windows 10/11 update:
When I uninstall this update, the old version of our application works fine again.
The dilemma we have now, however, is this:
The customers who have this old version cannot upgrade to a newer version because each version is hard-coupled to a specific gauge. Theoretically, each customer would have to send the gauge back to our hardware manufacturer to have new firmware flashed onto it to make it work with our new version, but this is not so easy given the number of gauges already in the field.
Here are my questions:
- Has anyone else seen this behavior?
- Is there a workaround to get the software working again without tweaking it or permanently suppressing Windows Update itself?
I am very grateful for any answers.
Many greetings
Dave Sch.