从托管C++ DLL使用C#程序集时崩溃

Fre*_*abe 1 c# c++ crash dll managed

在Windows XP系统上,我正在编写一个Mangaged C++库,它在C#程序集中调用代码.不幸的是,只要我开始在C#程序集中引用一个符号,运行Managed C++库就会失败,并显示此错误(我从XP崩溃对话框中复制了此错误):

EventType : clr20r3
P1 : treeviewdemo.exe
P2 : 0.0.0.0
P3 : 4a5d6d62
P4 : system.windows.forms
P5 : 2.0.0.0
P6 : 4889dee7
P7 : 12fc     
P8 : ac
P9 : system.io.filenotfoundexception    
Run Code Online (Sandbox Code Playgroud)

Manged C++库基本上只是:

#using "C:\\MyCSharpAssembly.dll";

__declspec(dllexport) void callMangagedCode() {
  ManagedObject ^o = nullptr;
}
Run Code Online (Sandbox Code Playgroud)

'#using'本身似乎没有引起任何问题,但是一旦我从C#DLL开始使用符号,我就会遇到问题.有人知道发生了什么吗?

system.io.filenotfoundexception部分让我觉得有些DLL没有找到,但我不知道它在哪个或哪里.

Aam*_*mir 5

所有依赖关系是否都在MyCSharpAssembly.dll同一条路径上?如果您不确定,请尝试在ILDasm工具中加载C-Sharp程序集,以找出它的依赖关系.

作为完整性检查,还要检查是否可以从另一个C-Sharp可执行文件加载此C-Sharp DLL.