Microsoft.InformationProtection.File.Ubuntu1804-libmip_dotnet.so的加载库失败

问题描述

我想在netcore3.1控制台应用程序中使用Microsoft.informationProtection.File.Ubuntu1804。我使用以下命令发布了我的应用程序:

dotnet publish MipConsole.csproj -o ../publish -f netcoreapp3.1 -c Release -r linux-x64

当我在docker映像(mcr.microsoft.com/dotnet/core/aspnet:3.1-bionic)中运行它时,出现以下错误

Unhandled exception. System.ComponentModel.Win32Exception (0x80004005): LoadLibrary Failed for: [/publish/libmip_dotnet.so]
   at Microsoft.informationProtection.Utils.SafeNativeMethods.LoadLibrary(String dllToLoad)
   at Microsoft.informationProtection.Utils.Loader.LoadDlls(String dllFolder,String dllName,String[] dllDependencies)
   at Microsoft.informationProtection.MIP.Initialize(MipComponent mipComponent,String path)
   at MipConsole.Program.Main(String[] args)
   at MipConsole.Program.<Main>(String[] args)

在另一篇文章中,Windows应用程序的解决方案是安装VC ++可再发行组件...但是Ubuntu的解决方案是什么?

解决方法

我正在努力对此进行记录。您可能会缺少Ubuntu的MIP SDK依赖项。您可以通过以下方式安装它们:

sudo apt-get install libgsf-1-dev libssl-dev libsecret-1-dev freeglut3-dev libcpprest-dev libcurl3-dev uuid-dev