Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF Multithreaded App crashed while calling API System.Windows.Application.LoadComponent(System.Object, System.Uri)

$
0
0

While loading multithreaded WPF application, I get intermitted exception and application gets crashed.

Scenario : Trying to load same XAML in different threads.

This exception occurs with different callstack also.

Application: AlstomGUI.exe

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: System.NullReferenceException

   at System.IO.Packaging.PackagePart.CleanUpRequestedStreamsList()

   at System.IO.Packaging.PackagePart.GetStream(System.IO.FileMode, System.IO.FileAccess)

   at System.Windows.Application.LoadComponent(System.Object, System.Uri)

   at Alstom.AlarmViewer.Controls.Als_AlarmViewer.InitializeComponent()

   at Alstom.AlarmViewer.Controls.Als_AlarmViewer..ctor()

 

Exception Info: System.Reflection.TargetInvocationException

   at System.RuntimeTypeHandle.CreateInstance(System.RuntimeType, Boolean, Boolean, Boolean ByRef, System.RuntimeMethodHandleInternal ByRef, Boolean ByRef)

   at System.RuntimeType.CreateInstanceSlow(Boolean, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)

   at System.Activator.CreateInstance(System.Type, Boolean)

   at System.RuntimeType.CreateInstanceImpl(System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, System.Object[], System.Threading.StackCrawlMark ByRef)

   at System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, System.Object[])

   at System.Activator.CreateInstance(System.Type, System.Object[])

   at System.Xaml.Schema.SafeReflectionInvoker.CreateInstanceCritical(System.Type, System.Object[])

   at System.Xaml.Schema.XamlTypeInvoker.CreateInstance(System.Object[])

   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstance(System.Xaml.XamlType, System.Object[])

   at System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(MS.Internal.Xaml.Context.ObjectWriterContext)

   at System.Xaml.XamlObjectWriter.WriteStartMember(System.Xaml.XamlMember)

   at System.Windows.Markup.WpfXamlLoader.TransformNodes(System.Xaml.XamlReader, System.Xaml.XamlObjectWriter, Boolean, Boolean, Boolean, System.Xaml.IXamlLineInfo, System.Xaml.IXamlLineInfoConsumer, MS.Internal.Xaml.Context.XamlContextStack`1<System.Windows.Markup.WpfXamlFrame>, System.Windows.Markup.IStyleConnector)

   at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)

   at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, Boolean, System.Uri)

   at System.Windows.Markup.XamlReader.Load(System.Xaml.XamlReader, System.Windows.Markup.ParserContext)

   at System.Windows.Markup.XamlReader.Load(System.Xml.XmlReader, System.Windows.Markup.ParserContext, System.Windows.Markup.XamlParseMode)

   at Alstom.Mimic.Common.AlsA_MultiStorageFile.GetPart[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.String, System.__Canon ByRef)

   at Alstom.Mimic.Common.AlsA_MimicFile.LoadMimic(System.Windows.UIElement ByRef)

   at Alstom.Mimic.Common.AlsA_MimicProxy.CreateNewMimic(Alstom.Mimic.Common.AlsA_Mimic ByRef)

   at Alstom.Mimic.Common.AlsA_MimicProxy.GetMimic(Alstom.Mimic.Common.AlsA_Mimic ByRef, Boolean)

   at Alstom.Mimic.Common.AlsA_MimicPreloader.LoadNextMimic(System.Object, System.EventArgs)

   at Alstom.Mimic.Common.AlsA_MimicPreloader.PreloadMimics(Int32, Boolean)

   at Alstom.ClientGUI.Workspace.App.StartPreloadForCurrentDispatcher(Int32, Boolean)

   at Alstom.ClientGUI.Workspace.App+<>c__DisplayClass183_0.<StartPreload>b__0()

 

Exception Info: System.Reflection.TargetInvocationException

   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)

   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])

   at System.Delegate.DynamicInvokeImpl(System.Object[])

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)

   at System.Windows.Threading.DispatcherOperation.InvokeImpl()

   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)

   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)

   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)

   at System.Windows.Threading.DispatcherOperation.Invoke()

   at System.Windows.Threading.Dispatcher.ProcessQueue()

   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)

   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)

   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)

   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)

   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)

   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)

   at Alstom.HyperWin.Server.AlsHyperWinDispatcher.ParallelRunCore(System.Object)

   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)

   at System.Threading.ThreadHelper.ThreadStart(System.Object)

 

 

 


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>