我在工作机环境下编译WPF项目,然后也能正常运行,但是当我将发布后的项目拷到另一台未安装VS2015但.net环境为4.6时无法运行,会抛以下异常,但是安装VS2015之后就可以正常运行。
应用程序: ceshi.heping.exe
Framework 版本: v4.0.30319
说明: 由于未经处理的异常,进程终止。
异常信息: System.IO.FileNotFoundException
在 Shenghe.Hebao.MainWindow..ctor()
异常信息: System.Windows.Markup.XamlParseException
在 System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
在 System.Windows.Markup.WpfXamlLoader.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, Boolean)
在 System.Windows.Application.DoStartup()
在 System.Windows.Application.<.ctor>b__1_0(System.Object)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
在 System.Windows.Threading.ExceptionWrapper.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.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
在 MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
在 System.Windows.Threading.DispatcherOperation.Invoke()
在 System.Windows.Threading.Dispatcher.ProcessQueue()
在 System.Windows.Threading.Dispatcher.WndProcHoo
错误应用程序名称: ceshi.heping.exe,版本: 1.0.0.0,时间戳: 0x5821d354
错误模块名称: KERNELBASE.dll,版本: 6.1.7601.18015,时间戳: 0x50b83c8a
异常代码: 0xe0434352
错误偏移量: 0x0000c41f
错误进程 ID: 0xdfc
错误应用程序启动时间: 0x01d2553c441a0047
错误应用程序路径: C:\Users\Wang\Desktop\ceshi.heping.exe
错误模块路径: C:\Windows\syswow64\KERNELBASE.dll
报告 ID: 820f639f-c12f-11e6-b426-10bf4805993b
我的工作机环境:
IDE:VS 2015 Professional
操作系统:win7
编译环境:C#6.0和 .net4.5.2
项目:WPF
运行环境:
操作系统:win7 带 .net 4.6