【发布时间】:2015-09-09 20:41:42
【问题描述】:
我正在尝试使用 ikvmstub.exe 将特定的 .NET dll (System.DirectoryServices) 转换为 Java 存根。我收到以下错误:
ikvmstub.exe System.DirectoryServices.dll
Error: unable to load assembly 'System.DirectoryServices.dll' as it depends on a higher version of mscorlib than the one currently loaded
我相信 DLL 依赖于我拥有的 v4.0.30319。所以我运行了这个命令,得到了以下输出:
ikvmstub.exe -nostdlib -r:/c/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll System.DirectoryServices.dll
Error: unable to find mscorlib.dll
我给 mscorlib 的路径绝对是正确的。作为记录,我在 Windows 7 中使用 Git Bash。我该如何解决这个错误?
【问题讨论】:
-
编写 DirectoryServices 的 java 存根似乎...奇怪。您可能想要编写一个 dll 来公开您需要的内容,并让该用户将 dll 调用改为 DirectoryServices。 (或者更好,find a Active Directory management java library)
-
是的,这很奇怪。我正在尝试允许用户在不输入密码的情况下对 AD 进行身份验证和查询。这在 C# 中是可能的,但在我熟悉的任何 Java 库中都没有。我认为通过将 DirectoryServices 库暴露给 Java,我可以利用 C# 对现有 AD 绑定的访问。