WPF 应用程序在启动时崩溃
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12353659/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WPF Application crash at start-up
提问by Patrick
I'm trying to start my application on another computer but when its starting it immediately crashes.
我试图在另一台计算机上启动我的应用程序,但是当它启动时它立即崩溃。
My application doesn't try to read a file while its starting up, but it still crashes with a System.IO.FileNotFoundException.
我的应用程序在启动时不会尝试读取文件,但它仍然以System.IO.FileNotFoundException.
I have no idea what to do about it, can anyone lend me some help with this?
我不知道该怎么办,有人可以帮我解决这个问题吗?
This dumpfile was generated by with the application crash.
此转储文件是由应用程序崩溃生成的。
<WERReportMetadata>
<OSVersionInformation>
<WindowsNTVersion>6.1</WindowsNTVersion>
<Build>7600 </Build>
<Product>(0x3): Windows 7 Home Premium</Product>
<Edition>HomePremium</Edition>
<BuildString>7600.16917.amd64fre.win7_gdr.111118-2330</BuildString>
<Revision>1</Revision>
<Flavor>Multiprocessor Free</Flavor>
<Architecture>X64</Architecture>
<LCID>1043</LCID>
</OSVersionInformation>
<ProblemSignatures>
<EventType>CLR20r3</EventType>
<Parameter0>bw000.exe</Parameter0>
<Parameter1>0.9.1.0</Parameter1>
<Parameter2>50461072</Parameter2>
<Parameter3>PresentationFramework</Parameter3>
<Parameter4>4.0.0.0</Parameter4>
<Parameter5>4d930fa2</Parameter5>
<Parameter6>9ef</Parameter6>
<Parameter7>f</Parameter7>
<Parameter8>System.IO.FileNotFoundException</Parameter8>
</ProblemSignatures>
<DynamicSignatures>
<Parameter1>6.1.7600.2.0.0.768.3</Parameter1>
<Parameter2>1043</Parameter2>
<Parameter22>0a9e</Parameter22>
<Parameter23>0a9e372d3b4ad19135b953a78882e789</Parameter23>
<Parameter24>0a9e</Parameter24>
<Parameter25>0a9e372d3b4ad19135b953a78882e789</Parameter25>
</DynamicSignatures>
<SystemInformation>
<MID>4F696B6F-82CF-4635-A6C8-BA2F7C68C6CA</MID>
<SystemManufacturer>MICRO-STAR INTERNATIONAL CO., LTD</SystemManufacturer>
<SystemProductName>MS-6657</SystemProductName>
<BIOSVersion>V1.30</BIOSVersion>
</SystemInformation>
I checked my file in the release folder and PresentationFramework.dll is there.
我检查了发布文件夹中的文件,并且 PresentationFramework.dll 在那里。
Update:
更新:
I tried installing .NET Framework 3.5, it didn't run. I think its because i have .NET 4 installed.
我尝试安装 .NET Framework 3.5,但它没有运行。我认为这是因为我安装了 .NET 4。
I took the advice of Simon and looked in the Windows events log and found and stack trace of the error.
我接受了 Simon 的建议,并查看了 Windows 事件日志,找到了错误的堆栈跟踪。
This is the situation now:
现在的情况是这样的:
I have an 64-bit Windows 7 Home Premium to run the application on.
The application is compiled as an 32-bit application.
I have .Net 4 Extended and Client installed.
I have set my main project and module project to run on .NET 4
I have set an
DispatcherUnhandledExceptionbut it isn't invoked, so it crashes before that.
我有一个 64 位的 Windows 7 Home Premium 来运行该应用程序。
该应用程序被编译为 32 位应用程序。
我安装了 .Net 4 Extended 和 Client。
我已将主项目和模块项目设置为在 .NET 4 上运行
我已经设置了
DispatcherUnhandledException但它没有被调用,所以它在此之前崩溃了。
so can anyone help me with this ?
任何人都可以帮我解决这个问题吗?
This is the strack trace from the Windows Event logs:
这是来自 Windows 事件日志的 strack 跟踪:
Log Name: Application
Source:. NET Runtime
Date: 13/09/2012 9:12:51
Event ID: 1026
Task Category: None
Level: Error
Keywords: Classic
User: NA
Computer: PC-freedom
Description:
Application: BW000.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack:
???at BW000.App.OnStartup (System.Windows.StartupEventArgs)
???ate 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, Cleanup code, 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.Threading.Dispatcher.Run ()
???at System.Windows.Application.RunDispatcher (System.Object)
???at System.Windows.Application.RunInternal (System.Windows.Window)
???at System.Windows.Application.Run (System.Windows.Window)
???at BW000.App.Main ()
????
Event XML:
?<event Xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
???<System>
?????<Provider Name=".NET Runtime" />
?????<EventID Qualifiers="0"> 1026 </ EventID>
?????<level> 2 </ Level>
?????<Task> 0 </ Task>
?????<keywords> 0x80000000000000 </ Keywords>
?????<TimeCreated SystemTime="2012-09-13T07:12:51.000000000Z" />
?????<EventRecordID> 525 </ EventRecordID>
?????<channel> Application </ Channel>
?????<computer> Freedom-PC </ Computer>
?????<Security />
???</ System>
???<EventData>
???<Data> Application: BW000.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack:
???at BW000.App.OnStartup (System.Windows.StartupEventArgs)
???ate 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, Cleanup code, 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.Threading.Dispatcher.Run ()
???at System.Windows.Application.RunDispatcher (System.Object)
???at System.Windows.Application.RunInternal (System.Windows.Window)
???at System.Windows.Application.Run (System.Windows.Window)
???at BW000.App.Main ()
</ Data>
??</ Event Data>
</ Event>
Here some extra information that i found:
这是我发现的一些额外信息:
Log Name: Application
Source: Application Error
Date: 13/09/2012 9:12:52
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: NA
Computer: PC-freedom
Description:
Name of application with error: BW000.exe, version: 0.1.0.0, time stamp: 0x504dfc8f
Name of module with error: KERNELBASE.dll, version: 6.1.7601.17514, time stamp: 0x4ce7bafa
Exception code: 0xe0434352
Fault offset: 0x0000b727
ID of process error: 0xf90
Start time of application with error: 0x01cd917f300ba4e0
Path to application with error: C: \ Users \ freedom \ AppData \ Roaming \ Boomerweb \ Boomerweb Platform \ App \ BW000.exe
Path to module with error: C: \ Windows \ syswow64 \ KERNELBASE.dll
Report Id: 6e2030c0-fd72-11e1-9968-406186e5690b
Event XML:
<event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
?? <System>
???? <Provider Name="Application Error" />
???? <EventID Qualifiers="0"> 1000 </ EventID>
???? <level> 2 </ Level>
???? <Task> 100 </ Task>
???? <keywords> 0x80000000000000 </ Keywords>
???? <TimeCreated SystemTime="2012-09-13T07:12:52.000000000Z" />
???? <EventRecordID> 526 </ EventRecordID>
???? <channel> Application </ Channel>
???? <computer> Freedom-PC </ Computer>
???? <Security />
?? </ System>
?? <EventData>
???? <Data> BW000.exe </ Data>
???? <Data> 0.1.0.0 </ Data>
???? <Data> 504dfc8f </ Data>
???? <Data> KERNELBASE.dll </ Data>
???? <Data> 6.1.7601.17514 </ Data>
???? <Data> 4ce7bafa </ Data>
???? <Data> E0434352 </ Data>
???? <Data> 0000b727 </ Data>
???? <Data> F90 </ Data>
???? <Data> 01cd917f300ba4e0 </ Data>
???? <Data> C: \ Users \ freedom \ AppData \ Roaming \ Boomerweb \ Boomerweb Platform \ App \ BW000.exe </ Data>
???? <Data> C: \ Windows \ syswow64 \ KERNELBASE.dll </ Data>
???? <Data> 6e2030c0-fd72-11e1-9968-406186e5690b </ Data>
?? </ Event Data>
</ Event>
回答by Patrick
Sorry for this late response, the problem was not in .NET but an Microsoft Redistributable that wasn't installed.
很抱歉这么晚才回复,问题不在 .NET 中,而是未安装的 Microsoft Redistributable。
Thank for your responses.
感谢您的回复。
回答by Mike Payne
Make sure the client computer has the same version of the .NET Framework that you used to create the application.
确保客户端计算机具有用于创建应用程序的相同版本的 .NET Framework。
回答by Aghilas Yakoub
You can install on your machine WPF Framework
您可以在您的机器上安装 WPF 框架
On this you have 3.5 Version with Service Pack 1
在此您有 3.5 版本的 Service Pack 1
Link : http://www.microsoft.com/en-us/download/details.aspx?id=22
链接:http: //www.microsoft.com/en-us/download/details.aspx?id=22
If you want just download assembly (PresentationFramework.dll or others ) :
如果您只想下载程序集(PresentationFramework.dll 或其他):
Link : http://www.search-dll.com/dll-files/download/presentationframework.dll.html
链接:http: //www.search-dll.com/dll-files/download/presentationframework.dll.html

