在64位和32位PC上运行.NET C#程序

在64位和32位PC上运行.NET C#程序,c#,.net,wpf,scimore,C#,.net,Wpf,Scimore,我有一个C#程序,在我的64位Win 7 pc上运行正常。我使用VS 2010 pro。这是一个使用Scimore嵌入式数据库的简单程序。但是,当我尝试在旧的Win XP(32位)笔记本电脑上安装并运行该程序以在该平台上进行测试时,它崩溃了。这是紧急停车场 Application: DevelopmentDirBackupWPF.exe Framework Version: v4.0.30319 Description: The process was terminated due to an

我有一个C#程序,在我的64位Win 7 pc上运行正常。我使用VS 2010 pro。这是一个使用Scimore嵌入式数据库的简单程序。但是,当我尝试在旧的Win XP(32位)笔记本电脑上安装并运行该程序以在该平台上进行测试时,它崩溃了。这是紧急停车场

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()
应用程序:developmentdirbackuppf.exe
框架版本:v4.0.30319
描述:由于未处理的异常,进程已终止。
异常信息:System.Windows.Markup.XamlParseException
堆栈:
位于System.Windows.Markup.XamlReader.RewrapException(System.Exception、System.Xaml.ixamlineinfo、System.Uri)
在System.Windows.Markup.wpfxamloader.Load(System.Xaml.XamlReader、System.Xaml.IXamlObjectWriterFactory、Boolean、System.Object、System.Xaml.XamlObjectWriterSettings、System.Uri)
位于System.Windows.Markup.wpfxamloader.LoadBaml(System.Xaml.XamlReader,Boolean,System.Object,System.Xaml.Permissions.XamlAccessLevel,System.Uri)
位于System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream、System.Windows.Markup.ParserContext、System.Object、Boolean)
位于System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream、System.Windows.Markup.ParserContext)
位于System.Windows.Application.LoadComponent(System.Uri,布尔值)
在System.Windows.Application.DoStartup()中
在System.Windows.Application.b__1(System.Object)中
位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate、System.Object、Int32)
位于MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object、System.Delegate、System.Object、Int32、System.Delegate)
在System.Windows.Threading.DispatcherOperation.InvokeImpl()中
位于System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
位于System.Threading.ExecutionContext.runTryCode(System.Object)
在System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuarantedCleanup(TryCode,CleanupCode,System.Object)中
位于System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext、System.Threading.ContextCallback、System.Object)
在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,布尔值)
在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object)上运行
在System.Windows.Threading.DispatcherOperation.Invoke()中
在System.Windows.Threading.Dispatcher.ProcessQueue()中
位于System.Windows.Threading.Dispatcher.WndProcHook(IntPtr、Int32、IntPtr、IntPtr、Boolean ByRef)
位于MS.Win32.hwndwapper.WndProc(IntPtr、Int32、IntPtr、IntPtr、Boolean ByRef)
位于MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate、System.Object、Int32)
位于MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object、System.Delegate、System.Object、Int32、System.Delegate)
位于System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority,System.TimeSpan,System.Delegate,System.Object,Int32)
在MS.Win32.HwndSubclass.SubclassWndProc(IntPtr,Int32,IntPtr,IntPtr)
位于MS.Win32.unsafentivemethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
位于System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
位于System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
位于System.Windows.Application.RunDispatcher(System.Object)
位于System.Windows.Application.RunInternal(System.Windows.Window)
在System.Windows.Application.Run(System.Windows.Window)中
在System.Windows.Application.Run()处
在developmentDirbackuppf.App.Main()上
我试过很多东西。我已经将VS build config设置为“任意CPU”和“x86”,但它仍然崩溃。我已经在我的电脑上安装了32位配置的Scimore db。有人有什么想法吗?谢谢


Ed Cohen

VS容易混淆32位平台和32位平台目标

在64位Win 7 PC上尝试此功能

它将告诉64位和32位windows在32位环境中运行应用程序

检查使用此配置运行时的错误是否相同。您可能已经安装了32位二进制文件,但您仍然可以在VS配置中指向64位DLL。也检查一下

记住,对“发布”配置也要这样做


框架版本是4.0抱歉,Edgar意识到,当我看到您使用VS 2010时,我认为您应该尝试3.0,而且xaml解析异常不应该与处理器有任何关系。我可能错了。如果您能够,请尝试使用它来检查抛出的实际异常。如果做不到这一点,请在应用程序中添加一些日志。谢谢您的回答,我将尝试使用3.0。问题,我可以设置VS来编译和使用V3.0。我在笔记本电脑上安装了V4.0。我必须在笔记本电脑上卸载4.0并安装3.0吗?我认为.NET是向上兼容的。谢谢你提供的信息。问题,在“应用程序”选项卡上,我应该将目标框架设置为:.NET Framework 4还是.NET Framework 4客户端配置文件?好的,我切换到了另一个项目。它是我的自定义库的测试平台。在其他项目中,我有几个定制的WPF对象。我试着在我的32位pc上运行它,但当我弹出我开发的2 WPF自定义窗口时,它崩溃了。我试过使用.NETFramework4,NETFramework4客户端配置文件。同样的结果,我崩溃了。你可能没有在XP机器上安装.NET4。也许先试试安装。或者,您可能希望将.NET3.5作为目标,它在更多的机器中都可以找到,但是您将无法使用.NET4中包含的所有功能。谢谢Steven。嗯,我在xp机器上有NET4。我确实试图将目标锁定在NET 3.5上,但正如您所提到的,有几个项目不存在,它确实存在