Ubuntu 22.04环境下.NET MIP SDK加载库失败问题求助
问题:Azure Unix环境下MIP SDK加载失败(Windows环境正常)
当前环境配置
- 运行容器:
mcr.microsoft.com/dotnet/sdk:7.0-jammy(Ubuntu 22.04) - .NET版本:7.0
- MIP SDK包版本:
Microsoft.InformationProtection.File.Ubuntu22041.14.108 - 已安装所有示例依赖:
sudo apt-get install scons libgsf-1-dev libssl-dev libsecret-1-dev freeglut3-dev libcpprest-dev libcurl3-dev uuid-dev
问题详情
1. 库编译适配错误:引用Ubuntu 22.04已弃用的libdl.so
Windows环境测试正常,但在Azure Unix环境中启动时抛出以下错误:
System.DllNotFoundException: Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: /workspace/RestAPI/bin/Debug/net7.0/runtimes/linux/native/libdl.so.so: cannot open shared object file: No such file or directory /usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.14/libdl.so.so: cannot open shared object file: No such file or directory /workspace/RestAPI/bin/Debug/net7.0/libdl.so.so: cannot open shared object file: No such file or directory /workspace/RestAPI/bin/Debug/net7.0/runtimes/linux/native/liblibdl.so.so: cannot open shared object file: No such file or directory /usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.14/liblibdl.so.so: cannot open shared object file: No such file or directory /workspace/RestAPI/bin/Debug/net7.0/liblibdl.so.so: cannot open shared object file: No such file or directory /workspace/RestAPI/bin/Debug/net7.0/runtimes/linux/native/libdl.so: cannot open shared object file: No such file or directory /usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.14/libdl.so: cannot open shared object file: No such file or directory /workspace/RestAPI/bin/Debug/net7.0/libdl.so: cannot open shared object file: No such file or directory /workspace/RestAPI/bin/Debug/net7.0/runtimes/linux/native/liblibdl.so: cannot open shared object file: No such file or directory /usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.14/liblibdl.so: cannot open shared object file: No such file or directory /workspace/RestAPI/bin/Debug/net7.0/liblibdl.so: cannot open shared object file: No such file or directory
通过创建软链接临时解决,但并非理想方案:sudo ln -s /usr/lib/aarch64-linux-gnu/libdl.so.2 /usr/lib/aarch64-linux-gnu/libdl.so
2. libmip_dotnet.so加载失败
解决上述问题后,出现新的加载错误:
System.ComponentModel.Win32Exception (0x80004005): LoadLibrary failed for: [/workspace/RestAPI/bin/Debug/net7.0/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 Microsoft.InformationProtection.MIP.CreateMipContext(MipConfiguration mipConfiguration)
尝试GitHub上建议的C代码片段排查,仍报错:
err = ./libmip_dotnet.so: cannot open shared object file: No such file or directory
请求帮助
现有在线资源无法解决上述问题,恳请提供可行的修复方案,或告知联系MIP SDK开发团队的有效途径。
内容的提问来源于stack exchange,提问作者Paulius Putna
相关产品推荐
相关产品推荐

