缺少与Visual Studio 2015的C#和C ++ Redistributable的依赖关系

时间:2016-03-21 15:14:58

标签: c# c++ dll c++-cli

我使用C ++ / CLI包装器运行在C#.NET中编程的应用程序到C ++库。它在Windows 7上完美运行。但是当我在Windows XP上运行这个应用程序时,它会崩溃。

我已安装" C ++ Redistributable for Visual Studio 2015"但是没有工作。

依赖性walker输出:

Starting profile on 21/03/2016 at 16:02:58

Operating System: Microsoft Windows XP Professional (32-bit), version 5.01.2600 Service Pack 3
Program Executable: c:\documents and settings\alejandro\escritorio\release - net\SAMPLE.EXE
Program Arguments: 
Starting Directory: C:\Documents and Settings\Alejandro\Escritorio\Release - NET\
Search Path: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem

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.
     Log DllMain calls for all other messages, including thread attach and thread detach.
     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.
     Automatically open and profile child processes.
--------------------------------------------------------------------------------

Started "SAMPLE.EXE" (process 0x244) at address 0x00400000.  Successfully hooked module.
Loaded "NTDLL.DLL" at address 0x7C910000.  Successfully hooked module.
Loaded "MSCOREE.DLL" at address 0x79000000.  Successfully hooked module.
Loaded "KERNEL32.DLL" at address 0x7C800000.  Successfully hooked module.
DllMain(0x7C910000, DLL_PROCESS_ATTACH, 0x00000000) in "NTDLL.DLL" called.
DllMain(0x7C910000, DLL_PROCESS_ATTACH, 0x00000000) in "NTDLL.DLL" returned 1 (0x1).
DllMain(0x7C800000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNEL32.DLL" called.
DllMain(0x7C800000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNEL32.DLL" returned 1 (0x1).
Injected "DEPENDS.DLL" at address 0x08370000.
DllMain(0x79000000, DLL_PROCESS_ATTACH, 0x00000000) in "MSCOREE.DLL" called.
DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "DEPENDS.DLL" called.
DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "DEPENDS.DLL" returned 1 (0x1).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MSCOREE.DLL" at address 0x79006F3C and returned 0xFFBADD11.
Exited "SAMPLE.EXE" (process 0x244) with code -1073740791 (0xC0000409).

1 个答案:

答案 0 :(得分:0)

检查平台工具集的设置:打开项目属性,在Configuration Properties / General下,设置“Platform Toolset”。对于Visual Studio 2012和2013,有一个用于定位Windows XP的单独工具集。我假设VS 2015仍然存在此设置,因此请确保选择了“_xp”变体。

另外,请确保您在XP机器上运行Release版本,而不是Debug版本。