首页 > 解决方案 > Microsoft 信息保护 SDK 1.7.133 - 加载库失败问题错误

问题描述

我之前使用的是 MIP SDK 1.6,我通过提供 Path 来初始化 MIP。它工作正常。我升级到 1.7 版本,现在它因 Load library failed 错误而失败。

{"Message":"发生错误。","ExceptionMessage":"LoadLibrary failed for: [C:\inetpub\wwwroot\teststs\bin\x64\mip_dotnet.dll]", "ExceptionType":"System.ComponentModel .Win32Exception","StackTrace":" 在 Microsoft.InformationProtection.Utils.SafeNativeMethods.LoadLibrary(String dllToLoad)\r\n 在 Microsoft.InformationProtection.Utils.Loader.LoadDlls(String dllFolder, String dllName, String[] dllDependencies)\ r\n 在 Microsoft.InformationProtection.MIP.Initialize(MipComponent mipComponent, 字符串路径)\r\n

有人可以帮忙吗?

标签: microsoft-information-protection

解决方案


你能分享一下你是如何构建路径并在 MipContext 中设置它的吗?像这样的东西应该仍然有效。我已经在 MIP SDK 1.7.133 上的 .NET 项目中对此进行了测试。

// Set path to bins folder.
var path = Path.Combine(
            Directory.GetParent(Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath)).FullName,
            Environment.Is64BitProcess ? "bin\\x64" : "bin\\x86");

// Initialize MIP for File API.  
MIP.Initialize(MipComponent.File, path);

推荐阅读