3

每当我在 bin 文件夹中的应用程序中添加新的 dll 并访问该 dll 时,它都会给我以下错误:

无法加载文件或程序集“~\bin\mydll.dll”或其依赖项之一。该模块应包含程序集清单。

是什么导致了这个问题,我该如何解决?

4

2 回答 2

1

You can use Dependency Walker Tool - it shows you what library in dependency is missing.

If the missing library is MFC or any Visual C++ runtime, then install theMicrosoft redistributable package (it should be from the same Visual Studio on which you're building the DLL).

Also, you can set the static linking to MFC or VC++ Runtime Libraries. In that case, you will not need to put Visual C++ runtime into the setup

This configure in project settings C/C++ -> Code Generation node - use MT for Release and MTd for Debug

MFC runtime is configured on General project tab.

于 2012-09-18T11:54:26.357 回答
1

您使用的 .dll 是否包含本机代码?如果是这样,这个答案可能会有所帮助https://stackoverflow.com/a/11343920/771034

于 2012-09-18T11:31:09.200 回答