0

I have a C# program that runs ok on my 64 bit Win 7 pc. I use VS 2010 pro. It is a simple program that uses the Scimore embedded db. But, when I try and install and run this program on my old Win XP (32 bit) laptop for testing on that platform, it crashes. Here is the crash dump

Application: DevelopmentDirBackupWPF.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Windows.Markup.XamlParseException
Stack:
   at System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)
   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.<.ctor>b__1(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at MS.Internal.Threading.ExceptionFilterHelper.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.runTryCode(System.Object)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   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.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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.InvokeImpl(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 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 DevelopmentDirBackupWPF.App.Main()

I have tried a lot of things. I have set VS build config to both "Any CPU" and "x86" and it still crashes. I have installed the 32 bit configuration of Scimore db on my pc. Anyone have any ideas? Thanks.

Ed Cohen

  • The framework version is 4.0 – Edgar Cohen Feb 05 '14 at 00:41
  • Sorry Edgar, realised that when I saw you were using VS 2010 – Lukazoid Feb 05 '14 at 00:41
  • I think you should try 3.0 also xaml parse exception should not have anything to do with the processor. I could be wrong. – RadioSpace Feb 05 '14 at 00:43
  • 1
    If you are in the position to, try to use [remote debugging](http://msdn.microsoft.com/en-us/library/bt727f1t(v=vs.100).aspx) which should allow you to examing the actual exception thrown. Failing that, add some logging into your application – Lukazoid Feb 05 '14 at 00:43
  • thank you for your answer I'll try using 3.0. Question, I can set VS to compile and use v 3.0. I have V4.0 installed on the laptop. Will I have to uninstall 4.0 and install 3.0 on the laptop? I thought .NET was upward compatible. – Edgar Cohen Feb 05 '14 at 01:01
  • The exception doesn't look to be related to bitness. Are you sure you have the same version of .NET on both machines? – Brian Rasmussen Feb 05 '14 at 02:49

1 Answers1

1

VS makes it easy to confuse 32bit Platform and 32bit Platform Target.

Try this on your 64bit Win 7 PC.

It will tell both 64 and 32 bit windows to run your application on the 32 bit environment.

Check to see if the error is the same when your run with this config. You may have installed a 32 bit binary - but you could still be pointing to a 64bit DLL in your VS config. Check that as well.

Remeber to do the same for your 'Release' configuration.

enter image description here

Steven de Salas
  • 20,944
  • 9
  • 74
  • 82
  • Thank you for the information. Question, on the application tab, What should I set the Target Framework to: .NET Framework 4 OR .NET Framework 4 Client profile? – Edgar Cohen Feb 05 '14 at 21:19
  • OK, I switched to another project. It is a test bed for my custom libraries. I has among other items, several customized WPF objects. I tried to run it on my 32 bit pc and it works but it crashes when I popup the 2 WPF custom windows I developed. I have tried using .net framework 4, net framework 4 client profile. It has the same result, I crashes. – Edgar Cohen Feb 05 '14 at 21:53
  • You may not have .NET 4 installed in the XP machine. Maybe try installing that first. Alternatively you might want to target .NET 3.5 which is found in more machines, however you wont be able to use all the goodies included in .NET 4. – Steven de Salas Feb 05 '14 at 23:55
  • Thank you Steven. Well, I do have NET 4 on the xp machine. I did try to target to NET 3.5 but several items, as you mentioned, were not there and it did not compile. So, I have no choice but to revert to using good old win forms. Not great, because I do like WPF, but in this case I feel I have to. I am currently using a 64 bit pc and I know a lot of people still have XP 32 bit pcs. Thanks. – Edgar Cohen Feb 06 '14 at 14:39