2014-10-31 85 views
1

我部署了我的WPF(Windows Presentation Foundation)應用程序,它使用.Net Framework 4.5構建爲32bit應用程序。 我在客戶機上運行應用程序(Windows 7 64bit)。本機安裝.Net Framework 4.5Visual C++ Redistributable Packages for Visual Studio 2013。它發射時墜毀。WPF應用程序崩潰XamlParseException和System.IO.FileNotFoundException?

我使用Dependency Walker來描述它,波紋管是DW的日誌。


Starting profile on 10/31/2014 at 4:58:32 PM 

Operating System: Microsoft Windows NT/2000/XP/2003/Vista based Ultimate (64-bit), version 6.01.7601 Service Pack 1 
Program Executable: \\tuyetam-pc\users\administrator\desktop\mystic server setup 20141025\mystic server v2.0 alpha (32bit)\MYSTICSERVER.EXE 
Program Arguments: 
Starting Directory: \\TUYETAM-PC\Users\Administrator\Desktop\Mystic Server Setup 20141025\Mystic Server v2.0 Alpha (32bit)\ 
Search Path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\ 

Options Selected: 
    Simulate ShellExecute by inserting any App Paths directories into the PATH environment variable. 
    Log DllMain calls for process attach and process detach messages. 
    Hook the process to gather more detailed dependency information. 
    Log LoadLibrary function calls. 
    Log GetProcAddress function calls. 
    Log first chance exceptions. 
    Log debug output messages. 
    Use full paths when logging file names. 
    Automatically open and profile child processes. 
-------------------------------------------------------------------------------- 

Started "\\tuyetam-pc\users\administrator\desktop\mystic server setup 20141025\mystic server v2.0 alpha (32bit)\MYSTICSERVER.EXE" (process 0xB64) at address 0x000C0000. Successfully hooked module. 
Loaded "c:\windows\syswow64\NTDLL.DLL" at address 0x77E10000. Successfully hooked module. 
Loaded "c:\windows\syswow64\MSCOREE.DLL" at address 0x71E30000. Successfully hooked module. 
Loaded "c:\windows\syswow64\KERNEL32.DLL" at address 0x75800000. Successfully hooked module. 
Loaded "c:\windows\syswow64\KERNELBASE.DLL" at address 0x773A0000. Successfully hooked module. 
DllMain(0x773A0000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\windows\syswow64\KERNELBASE.DLL" called. 
DllMain(0x773A0000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\windows\syswow64\KERNELBASE.DLL" returned 1 (0x1). 
DllMain(0x75800000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\windows\syswow64\KERNEL32.DLL" called. 
DllMain(0x75800000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\windows\syswow64\KERNEL32.DLL" returned 1 (0x1). 
Injected "c:\users\administrator\desktop\depends22_x86\DEPENDS.DLL" at address 0x08370000. 
DllMain(0x71E30000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\windows\syswow64\MSCOREE.DLL" called. 
DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\users\administrator\desktop\depends22_x86\DEPENDS.DLL" called. 
DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\users\administrator\desktop\depends22_x86\DEPENDS.DLL" returned 1 (0x1). 
GetProcAddress(0x75800000 [c:\windows\syswow64\KERNEL32.DLL], "FlsAlloc") called from "c:\windows\syswow64\MSCOREE.DLL" at address 0x71E36F3C and returned 0x75814EE3. 

STATUS_STACK_BUFFER_OVERRUN encountered 
Entrypoint reached. All implicit modules have been loaded. 
Exited "\\tuyetam-pc\users\administrator\desktop\mystic server setup 20141025\mystic server v2.0 alpha (32bit)\MYSTICSERVER.EXE" (process 0xB64) with code -1073740791 (0xC0000409). 

當我試圖捕捉應用程序異常,異常信息是低於

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. 

不,當我試圖客戶機上安裝Visual Studio 2013,然後該程序是工作得很好。

和更多信息:這是我的應用程序

  • 的1.1版本在上一版本(1.0),我用VS 2012和.NET 4.0,而我部署成功的版本1.0。

  • 在此版本(1.1)中:我將所有項目更新到VS 2013並使用.Net 4.5。所以我不知道這些步驟是否導致了問題?我需要使用.Net 4.5作爲異步/等待方法。

有人可以告訴我這個問題嗎?

非常感謝!

+4

您是否嘗試過在應用程序中捕獲未處理的異常? – japesu 2014-10-31 10:15:39

+0

你確定你的主窗口的xaml文件是正確的嗎? – Keysharpener 2014-10-31 14:43:46

+0

請在上面看到我的更新,謝謝! – TTGroup 2014-11-02 15:17:01

回答

1

錯誤消息:

無法加載文件或程序集「CPPWrapper.dll」或它的一個依賴。指定的模塊無法找到。

表示無法加載引用程序集'CPPWrapper.dll'。通常這意味着該文件與可執行文件或GAC中的文件不在同一目錄中,或者預期版本和實際版本不同。如果缺少「CPPWrapper.dll」的相關程序集,則也是如此。

給出名稱,程序集很可能是C++包裝程序集。這意味着它可能依賴於外部庫或框架文件(可能甚至是不同的處理器架構)。

一個有用的工具來分析依賴相關的問題是Fusion Log Viewer

+0

是的,我考慮過這種情況,但DW並不能告訴我確切的問題。 – TTGroup 2014-11-02 15:28:04

+0

我試圖在客戶機上安裝Visual Studio 2013,並且程序工作正常。所以我無法使用Fusion Log Viewer來檢測問題。你有什麼建議嗎?謝謝! – TTGroup 2014-11-03 06:25:47

+1

不,它清楚地表明VS缺少一個安裝組件。也許正確的VC++運行時或類似的東西。 – 2014-11-03 07:39:37

0

今天,我試圖安裝更多的2個組成部分是:

  1. 的Visual C++可再發行的Visual Studio 2010
  2. 的Visual C++可再發行的Visual Studio 2012

其實,這個應用程序包包自2010年起開始使用VS 2010進行開發。然後我更新了使用VS 2012的項目,現在是VS 2013。

我很高興這種方式可以解決我的問題,但有人可以解釋我發生了什麼?