title: WPF Desktop Application Will not start in Windows 10
body: <p>I wrote a WPF C# application in visual studio 2010, but it will not start up on my Windows 10 Machine. I ran into this issue a while back on a different computer, and installing Direct X 9 fixed my issue, this time it did not. I tried compatibility mode, no luck. I also tried adding some exception handling to the initialization of the program like I've read on some other posts here, but it does not seem to even make it to that point when I start the app. This is what I do for that, I get no pop ups at all:</p>
  
  <pre><code>        protected override void OnInitialized(EventArgs e)
      {
          MessageBox.Show("OnInitialized");
          // hook on error before app really starts
          base.OnInitialized(e);
      }
  
      public override void BeginInit()
      {
          MessageBox.Show("BeginInit");
          AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
          Application.Current.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(Current_DispatcherUnhandledException);
  
          base.BeginInit();
      }
  
      protected override void OnSourceInitialized(EventArgs e)
      {
          MessageBox.Show("OnSourceInitialized");
  
          base.OnSourceInitialized(e);
      }
  
      void Current_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
      {
          MessageBox.Show(e.Exception.Message);
      }
  
      void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
      {
          // put your tracing or logging code here (I put a message box as an example)
          MessageBox.Show(e.ExceptionObject.ToString());
      }
  </code></pre>
  
  <p>When I look in the event viewer, I get two errors an Application Error:</p>
  
  <blockquote>
    <p>Faulting application name: BuildingManagerWPF.exe, version: 1.0.0.0,
    time stamp: 0x59e6d248 Faulting module name: KERNELBASE.dll, version:
    10.0.14393.479, time stamp: 0x58256d37 Exception code: 0xe0434352 Fault offset: 0x000da832 Faulting process id: 0x218 Faulting
    application start time: 0x01d347c8387ca8a0 Faulting application path:
    C:\Users\lattepanda\Desktop\Building\BuildingManagerWPF.exe
    Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll Report Id:
    08f61ca3-5455-4f5c-98df-1195f203d482 Faulting package full name: 
    Faulting package-relative application ID:</p>
  </blockquote>
  
  <p>And a .NET Runtime Error:</p>
  
  <blockquote>
    <p>Application: BuildingManagerWPF.exe Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.IO.FileNotFoundException    at
    BuildingManagerWPF.MainWindow..ctor()</p>
    
    <p>Exception Info: System.Windows.Markup.XamlParseException    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.LoadBaml(System.Xaml.XamlReader,
    Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel,
    System.Uri)    at
    System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream,
    System.Windows.Markup.ParserContext, System.Object, Boolean)    at
    System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream,
    System.Windows.Markup.ParserContext)    at
    System.Windows.Application.LoadComponent(System.Uri, Boolean)    at
    System.Windows.Application.DoStartup()    at
    System.Windows.Application.&lt;.ctor>b__1_0(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
    System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(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)<br>
    at
    MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG
    ByRef)    at
    System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
    at
    System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
    at System.Windows.Application.RunDispatcher(System.Object)    at
    System.Windows.Application.RunInternal(System.Windows.Window)    at
    System.Windows.Application.Run(System.Windows.Window)    at
    System.Windows.Application.Run()    at BuildingManagerWPF.App.Main()</p>
  </blockquote>