首页 > 解决方案 > .Net Core Docker 无法加载 DLL 'activeds.dll'

问题描述

我有一个在 IISExpress 上运行良好的 ASP.Net Core 应用程序。

我对 Docker 完全陌生,所以当我将 Docker 支持添加到项目并运行它时,这部分会阻塞:

DirectoryEntry processEntry = new DirectoryEntry("LDAP://MyLdap", user, password);
processEntry.Options.Referral = ReferralChasingOption.Subordinate;
DirectorySearcher searcher = new DirectorySearcher(processEntry);

出现错误:

DllNotFoundException: Unable to load DLL 'activeds.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

我认为这是因为 Docker 看不到 dll,所以我在 Dockerfile 中添加了以下内容:

COPY ["C:/Windows/System32/activeds.dll","activeds.dll"]

但这似乎并没有改善,如何使 dll 可用于 Docker 容器?

标签: c#dockerasp.net-core.net-core

解决方案


推荐阅读