C# WPF应用程序因XamlParseException和System.IO.FileNotFoundException而崩溃?

C# WPF应用程序因XamlParseException和System.IO.FileNotFoundException而崩溃?,c#,.net,wpf,C#,.net,Wpf,我部署了我的WPF(Windows Presentation Foundation)应用程序,它是使用.Net Framework 4.5构建的32位应用程序。 我在客户端计算机上运行应用程序(Windows7 64位)。该机器安装Visual Studio2013 > .NET框架4.5 < /C>和 VisualC++ +可再分发包。它发射时坠毁了 我正在使用Dependency Walker来分析它,下面是DW的日志 当我试图捕获应用程序异常时,异常信息如下 The error tim

我部署了我的WPF(Windows Presentation Foundation)应用程序,它是使用.Net Framework 4.5构建的
32位
应用程序。 我在客户端计算机上运行应用程序(
Windows7 64位
)。该机器安装Visual Studio2013 <代码> > .NET框架4.5 < /C>和<代码> VisualC++ +可再分发包。它发射时坠毁了

我正在使用Dependency Walker来分析它,下面是DW的日志


当我试图捕获应用程序异常时,异常信息如下

The error time: 11/2/2014 10:10 PM
Exception: System.Windows.Markup.XamlParseException: The invocation of the constructor on type 'DVRServerInterface.MainWindow' that matches the specified binding constraints threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'CPPWrapper.dll' or one of its dependencies. The specified module could not be found.
   at DVRServerInterface.MainWindow..ctor()
   --- End of inner exception stack trace ---
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
   at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
   at System.Windows.Application.DoStartup()
   at System.Windows.Application.<.ctor>b__1(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)___   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
   at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
   at System.Windows.Application.DoStartup()
   at System.Windows.Application.<.ctor>b__1(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
InnerException.Message:Could not load file or assembly 'CPPWrapper.dll' or one of its dependencies. The specified module could not be found.
错误时间:2014年11月2日晚上10:10
异常:System.Windows.Markup.XamlParseException:对与指定绑定约束匹配的类型“DVRServerInterface.MainWindow”调用构造函数时引发异常。-->System.IO.FileNotFoundException:无法加载文件或程序集“CPPWrapper.dll”或其依赖项之一。找不到指定的模块。
在DVRServerInterface.MainWindow..ctor()上
---内部异常堆栈跟踪的结束---
在System.Windows.Markup.WpfXamlLoader.Load(XamlReader XamlReader、IXamlObjectWriterFactory writerFactory、Boolean skipJournaledProperties、Object rootObject、XamlObjectWriterSettings设置、Uri baseUri)
位于System.Windows.Markup.wpfxamloader.LoadBaml(XamlReader XamlReader、Boolean skipJournaledProperties、Object rootObject、XamlAccessLevel accessLevel、Uri baseUri)
位于System.Windows.Markup.XamlReader.LoadBaml(Stream-Stream,ParserContext-ParserContext,Object-parent,Boolean-closeStream)
在System.Windows.Application.LoadBamlStreamWithSyncInfo(流,ParserContext pc)
位于System.Windows.Application.LoadComponent(Uri resourceLocator,布尔bSkipJournaledProperties)
在System.Windows.Application.DoStartup()中
在System.Windows.Application.b__1(未使用的对象)
位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(委托回调、对象参数、Int32 numArgs)
在MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(对象源、委托方法、对象参数、Int32 numArgs、委托catchHandler)处,在System.Windows.Markup.WpfXamlLoader.Load处(XamlReader XamlReader、IXamlObjectWriterFactory writerFactory、Boolean skipJournaledProperties、对象根对象、XamlObjectWriterSettings、Uri baseUri)
位于System.Windows.Markup.wpfxamloader.LoadBaml(XamlReader XamlReader、Boolean skipJournaledProperties、Object rootObject、XamlAccessLevel accessLevel、Uri baseUri)
位于System.Windows.Markup.XamlReader.LoadBaml(Stream-Stream,ParserContext-ParserContext,Object-parent,Boolean-closeStream)
在System.Windows.Application.LoadBamlStreamWithSyncInfo(流,ParserContext pc)
位于System.Windows.Application.LoadComponent(Uri resourceLocator,布尔bSkipJournaledProperties)
在System.Windows.Application.DoStartup()中
在System.Windows.Application.b__1(未使用的对象)
位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(委托回调、对象参数、Int32 numArgs)
位于MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(对象源、委托方法、对象参数、Int32 numArgs、委托catchHandler)
InnerException.Message:无法加载文件或程序集“CPPWrapper.dll”或其依赖项之一。找不到指定的模块。

当我尝试在客户机上安装Visual Studio 2013时,程序运行良好

更多信息:这是我的应用程序的1.1版

  • 在以前的版本(1.0)中,我使用了VS 2012和.Net 4.0,并成功部署了1.0版

  • 在这个版本(1.1):我将所有项目更新为VS 2013,并使用.Net 4.5。所以我不知道这些步骤是否导致了问题?我需要使用.Net 4.5进行asyn/WAIT方法

有人能告诉我这个问题吗

非常感谢!

错误消息:

无法加载文件或程序集“CPPWrapper.dll”或其依赖项之一。找不到指定的模块

指示它无法加载引用的程序集“CPPWrapper.dll”。通常这意味着该文件与可执行文件或GAC不在同一目录中,或者预期版本和实际版本不同。如果缺少“CPPWrapper.dll”中的从属程序集,也会出现这种情况

给出名称,程序集很可能是C++包装程序集。这意味着它可能依赖于外部库或框架文件(甚至不同的处理器体系结构)。


分析依赖关系相关问题的有用工具是。

今天,我尝试安装了两个以上的组件:

  • VisualStudio 2010
  • 的VisualC++可重分发包
  • VisualStudio 2012
  • 的VisualC++可重分发包 实际上,这个应用程序从2010年开始使用VS 2010进行开发。然后我更新了项目,使用VS 2012,现在是VS 2013


    当这种方法可以解决我的问题时,我非常高兴,但有人可以告诉我发生了什么?

    您尝试过在应用程序中捕获未处理的异常吗?您确定主窗口的xaml文件是正确的吗?请查看我上面的更新,谢谢!是的,我考虑过这些情况,但DW无法向我显示问题的确切原因。我尝试安装了Vi客户端机器上的sual Studio 2013,程序运行良好。因此,我无法使用Fusion Log Viewer检测问题。您有什么建议吗?谢谢!没有,这表明缺少VS的安装组件。可能是正确的VC++运行时或类似的东西。这取决于版本、操作系统等。也许Reflector对确定依赖项很有用。我相信您可以下载试用版。确定您没有引入其他依赖项或其他版本的依赖项?如果您比较csproj文件从那时到现在,它是否显示了依赖项的差异?
    The error time: 11/2/2014 10:10 PM
    Exception: System.Windows.Markup.XamlParseException: The invocation of the constructor on type 'DVRServerInterface.MainWindow' that matches the specified binding constraints threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'CPPWrapper.dll' or one of its dependencies. The specified module could not be found.
       at DVRServerInterface.MainWindow..ctor()
       --- End of inner exception stack trace ---
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
       at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
       at System.Windows.Application.DoStartup()
       at System.Windows.Application.<.ctor>b__1(Object unused)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)___   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
       at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
       at System.Windows.Application.DoStartup()
       at System.Windows.Application.<.ctor>b__1(Object unused)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    InnerException.Message:Could not load file or assembly 'CPPWrapper.dll' or one of its dependencies. The specified module could not be found.