Microsoft信息保护SDK 1.7.133-加载库失败问题

问题描述

我以前使用过MIP SDK 1.6,并且通过提供Path来初始化MIP。运行正常。 我升级到1.7版本,现在由于加载库失败而失败。

{“ Message”:“发生错误。”,“ ExceptionMessage”:“ LoadLibrary 失败: [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,字符串dllName,字符串[] dllDependencies)\ r \ n位于 Microsoft.informationProtection.MIP.Initialize(MipComponent mipComponent,字符串路径)\ r \ n

任何人都可以帮忙吗?

解决方法

您能否分享在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);