Prism/WPF/C#:尝试在其他计算机上运行已发布的ClickOnce应用程序时出现模块初始化异常。是什么导致了这个问题?

Prism/WPF/C#:尝试在其他计算机上运行已发布的ClickOnce应用程序时出现模块初始化异常。是什么导致了这个问题?,c#,wpf,prism,C#,Wpf,Prism,我正在使用WPF/Prism/C#开发一个应用程序。我正在使用Visual Studio 2015通过ClickOnce发布应用程序。应用程序在开发机器上运行良好,但在任何其他机器上安装后不会打开 来自开发机器: Win7 64位 我可以在Visual Studio中很好地打开应用程序。同样,已发布的ClickOnce版本安装并运行良好 来自其他机器: Win 8 64位 安装似乎成功,但此后将在启动时崩溃并立即关闭。发生这种情况时,我会在Windows事件查看器中看到以下消息: App

我正在使用WPF/Prism/C#开发一个应用程序。我正在使用Visual Studio 2015通过ClickOnce发布应用程序。应用程序在开发机器上运行良好,但在任何其他机器上安装后不会打开

来自开发机器:

  • Win7 64位
我可以在Visual Studio中很好地打开应用程序。同样,已发布的ClickOnce版本安装并运行良好

来自其他机器:

  • Win 8 64位
安装似乎成功,但此后将在启动时崩溃并立即关闭。发生这种情况时,我会在Windows事件查看器中看到以下消息:

Application: FilePlayer.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Prism.Modularity.ModuleInitializeException
Stack:
   at Prism.Modularity.ModuleInitializer.HandleModuleInitializationError(Prism.Modularity.ModuleInfo, System.String, System.Exception)
   at Prism.Modularity.ModuleInitializer.Initialize(Prism.Modularity.ModuleInfo)
   at Prism.Modularity.ModuleManager.LoadModulesThatAreReadyForLoad()
   at Prism.Modularity.ModuleManager.LoadModuleTypes(System.Collections.Generic.IEnumerable`1<Prism.Modularity.ModuleInfo>)
   at Prism.Modularity.ModuleManager.LoadModulesWhenAvailable()
   at Prism.Modularity.ModuleManager.Run()
   at Prism.Unity.UnityBootstrapper.InitializeModules()
   at Prism.Unity.UnityBootstrapper.Run(Boolean)
   at Prism.Bootstrapper.Run()
   at FilePlayer.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.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   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.LegacyInvokeImpl(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 FilePlayer.App.Main()

Log Name: Application
Source: .NET RunTime
Task Category: None
Level: Error
Event ID: 1026
应用程序:FilePlayer.exe
框架版本:v4.0.30319
描述:由于未处理的异常,进程已终止。
异常信息:Prism.Modularity.ModuleInitializeException
堆栈:
位于Prism.Modularity.ModuleInitializer.HandleModuleInitializationError(Prism.Modularity.ModuleInfo、System.String、System.Exception)
在Prism.Modularity.ModuleInitializer.Initialize处(Prism.Modularity.ModuleInfo)
在Prism.Modularity.ModuleManager.LoadModulesThatAreReadyForLoad()处
位于Prism.Modularity.ModuleManager.LoadModuleType(System.Collections.Generic.IEnumerable`1)
在Prism.Modularity.ModuleManager.LoadModulesWhenAvailable()处
在Prism.Modularity.ModuleManager.Run()处
在Prism.Unity.UnityBootTrapper.InitializeModules()中
在Prism.Unity.UnityBootTrapper.Run处(布尔值)
在Prism.Bootstrapper.Run()处
在FilePlayer.App.OnStartup(System.Windows.StartupEventArgs)上
在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.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.LegacyInvokeImpl(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()处
在FilePlayer.App.Main()上
日志名称:应用程序
源:.NET运行时
任务类别:无
级别:错误
事件ID:1026
是否有人能提供一些关于这个问题的原因的指导?此外,我如何尝试确定原因/解决此问题

因为我不知道原因是什么,所以我只提供项目的github:
如果您可以帮助缩小范围,我可以在项目中提供相关代码

我下载了你的样品并在我的机器上试用过。我也有同样的例外。当我导航到InnerException属性时,我发现您的
ItemListViewModel
构造函数失败,路径“F:\\ROMS\\SNES-ROMS”出现
DirectoryNotFoundException
。您在
consoles.json
文件中有此路径。您可能在部署应用程序的所有计算机上都没有此文件夹。您是否希望该文件夹存在于您部署应用程序的所有计算机中?对不起。。。看来我的最后几次承诺还没有完成。我将对此进行修复,并发表另一条评论作为确认,同时描述consoles.json应该如何工作(尽管我做了一些更改,以便在应用程序之外需要它)@sthotakura github现在应该适当地尝试从C:\FPJSON\consoles.json获取consoles.json。我已经发布了一个关于consoles.json应该是什么样子的指南。如果没有模拟器/ROM,您应该能够将控制台设置为使用媒体文件而不是模拟器/ROM运行vlc。作为应用程序部署的一部分,您是否会创建
C:\FPJSON\consoles.json
?否则,您仍然会得到该异常,因为应用程序无法在目标计算机上找到该文件。@sthotakura我同意用户现在需要提供C:\FPJSON\consoles.json。这次你遇到Prism.Modularity.ModuleInitializeException了吗?另外,您能帮助我确定如何调试此类问题吗?我下载了您的示例并在我的机器上进行了尝试。我也有同样的例外。当我导航到InnerException属性时,我