安装我的WPF应用程序后,我尝试运行该应用程序,它崩溃并在事件查看器中记录下面的错误。有人有想法吗?
'----------------------------------------------------------------------
Application: MyApp.Windows.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.Practices.Unity.ResolutionFailedException
Stack:
at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(System.Type, System.Object, System.String, System.Collections.Generic.IEnumerable`1<Microsoft.Practices.Unity.ResolverOverride>)
at Microsoft.Practices.Unity.UnityContainer.Resolve(System.Type, System.String, Microsoft.Practices.Unity.ResolverOverride[])
at Microsoft.Practices.Unity.UnityContainerExtensions.Resolve[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.Practices.Unity.IUnityContainer, Microsoft.Practices.Unity.ResolverOverride[])
at MyApp.Windows.IoC.Resolve[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]()
at MyApp.Windows.Navigation.NavigationController.Navigate(System.String, System.Windows.Controls.UserControl)
at MyApp.Windows.LoginWindow..ctor()
at MyApp.Windows.App.OnStartup(System.Windows.StartupEventArgs)
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.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 MyApp.Windows.App.Main()
答案 0 :(得分:5)
我知道这个帖子现在已经很老了,但我只是想说我只有相同的例外,解决方案也差不多。
事件查看器的输出与Joe的情况相同。 我设法在VS中捕获异常,它在为属性Views.MainWindow设置值时向我显示了“ResolutionFailedException”。
然而真正的问题是实体框架试图在一个不存在的目录中构建SqlCE数据库。非常基本,但异常是如此奇怪我虽然我会分享我的发现。