WPF application crashed with XamlParseException and System.IO.FileNotFoundException?

1

I deployed my WPF (Windows Presentation Foundation) application, it built as 32bit application using .Net Framework 4.5. I run the application on client machine (Windows 7 64bit). This machine installed .Net Framework 4.5 and Visual C++ Redistributable Packages for Visual Studio 2013. It crashed when launched.

I'm using Dependency Walker to profile it, and bellow is the log of 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).

When I try to catch the Application Exception, the exception info is below

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.

Not that when I tried to install Visual Studio 2013 on client machine, and then the program was worked fine.

And more information: This is version 1.1 of my app

  • In the previous version (1.0), I used VS 2012 and .Net 4.0, and I deployed successful version 1.0.

  • In this version (1.1): I updated all project to VS 2013 and using .Net 4.5. So I don't know these steps caused the problem or not? I need to use .Net 4.5 for asyn/await methods.

Someone can tel me the problem?

Many thanks!

c#
.net
wpf
asked on Stack Overflow Oct 31, 2014 by TTGroup • edited Nov 3, 2014 by TTGroup

2 Answers

1

The error message:

Could not load file or assembly 'CPPWrapper.dll' or one of its dependencies. The specified module could not be found.

Indicates it could not load the referenced assembly 'CPPWrapper.dll'. Usually this means the file is not in the same directory as the executable file or in the GAC, or the versions expected and actual are different. This is also the case if a dependent assembly from 'CPPWrapper.dll' is missing.

Giving the name, the assembly is most likely a C++ wrapper assembly. That means that it might depend on external libraries or framework files (maybe even different processor architecture) as installed.

A useful tool to analyse dependency related issues is the Fusion Log Viewer.

answered on Stack Overflow Nov 2, 2014 by Patrick Hofman • edited Nov 3, 2014 by Patrick Hofman
0

Today, I tried to install more 2 components are:

  1. Visual C++ Redistributable Packages for Visual Studio 2010
  2. Visual C++ Redistributable Packages for Visual Studio 2012

Actually, this application started development since 2010 with VS 2010. And then I updated project to use VS 2012 and now is VS 2013.

I'm very happy when this way can solve my issue, but someone can explain me what happen?

answered on Stack Overflow Nov 3, 2014 by TTGroup

User contributions licensed under CC BY-SA 3.0