在 Windows XP 系统上,我正在编写一个托管 C++ 库,它调用 C# 程序集中的代码。不幸的是,一旦我开始在 C# 程序集中引用一个符号,运行托管 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
Manged C++ 库基本上就是:
#using "C:\\MyCSharpAssembly.dll";
__declspec(dllexport) void callMangagedCode() {
ManagedObject ^o = nullptr;
}
'#using' 本身似乎没有引起任何问题,但是一旦我开始使用 C# DLL 中的符号,我就会遇到问题。有人知道发生了什么吗?
这system.io.filenotfoundexception
部分让我觉得找不到某些 DLL,但我不知道它在寻找哪个或在哪里。