有人成功在 Ubuntu 18.04 上运行 mipsdk-dotnet-file-quickstart-main 吗?

问题描述

我仍然无法获得运行 Ubuntu 18.04 的 mipsdk-dotnet-file-quickstart-main (mip_sdk_ubuntu1804_file_1.8.97)。

使用 msbuild 编译后确实出现以下错误

*#/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/bin/Debug# mono ```./MipSdkDotNetQuickstart.exe

Unhandled Exception:
System.EntryPointNotFoundException: LoadLibrary assembly:<unkNown assembly> type:<unkNown type> member:(null)
  at (wrapper managed-to-native) Microsoft.informationProtection.Utils.UnsafeNativeMethods.LoadLibraryWindows(string)
  at Microsoft.informationProtection.Utils.UnsafeNativeMethods.LoadLibrary (System.String dllToLoad) [0x00007] in <5d913da122e246aeb9d44ad373706d2f>:0
  at Microsoft.informationProtection.Utils.Loader.LoadDlls (System.String dllFolder,System.String dllName,System.String[] dllDependencies) [0x00021] in <5d913da122e246aeb9d44ad373706d2f>:0
  at Microsoft.informationProtection.MIP.Initialize (Microsoft.informationProtection.MipComponent mipComponent,System.String path) [0x00030] in <5d913da122e246aeb9d44ad373706d2f>:0
  at MipSdkDotNetQuickstart.Action..ctor (Microsoft.informationProtection.ApplicationInfo appInfo) [0x00020] in <ef313698562f4c0e81c7eb42440dde68>:0
  at MipSdkDotNetQuickstart.Program.Main (System.String[] args) [0x0002b] in <ef313698562f4c0e81c7eb42440dde68>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.EntryPointNotFoundException: LoadLibrary assembly:<unkNown assembly> type:<unkNown type> member:(null)
  at (wrapper managed-to-native) Microsoft.informationProtection.Utils.UnsafeNativeMethods.LoadLibraryWindows(string)
  at Microsoft.informationProtection.Utils.UnsafeNativeMethods.LoadLibrary (System.String dllToLoad) [0x00007] in <5d913da122e246aeb9d44ad373706d2f>:0
  at Microsoft.informationProtection.Utils.Loader.LoadDlls (System.String dllFolder,System.String path) [0x00030] in <5d913da122e246aeb9d44ad373706d2f>:0
  at MipSdkDotNetQuickstart.Action..ctor (Microsoft.informationProtection.ApplicationInfo appInfo) [0x00020] in <ef313698562f4c0e81c7eb42440dde68>:0
  at MipSdkDotNetQuickstart.Program.Main (System.String[] args) [0x0002b] in <ef313698562f4c0e81c7eb42440dde68>:0*

我做错了什么?

谢谢

附言编译日志:

*root@:~/azure/mipsdk-dotnet-file-quickstart-main# msbuild /restore

Microsoft (R) Build Engine version 16.6.0 for Mono
copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build,please add the "-m" switch.
Build started 3/28/2021 7:27:45 PM.
Project "/root/azure/mipsdk-dotnet-file-quickstart-main/MipSdkDotNetQuickstart.sln" on node 1 (Restore target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|Any cpu".
_GetAllRestoreProjectPathItems:
  Determining projects to restore...
Restore:
  Restoring packages for /root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/MipSdkDotNetQuickstart.csproj...
  Committing restore...
  Generating MSBuild file /root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/obj/MipSdkDotNetQuickstart.csproj.nuget.g.props.
  Generating MSBuild file /root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/obj/MipSdkDotNetQuickstart.csproj.nuget.g.targets.
  Writing assets file to disk. Path: /root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/obj/project.assets.json
  Restored /root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/MipSdkDotNetQuickstart.csproj (in 1.14 sec).
  NuGet Config files used:
      /root/.config/NuGet/NuGet.Config
  Feeds used:
      https://api.nuget.org/v3/index.json
Done Building Project "/root/azure/mipsdk-dotnet-file-quickstart-main/MipSdkDotNetQuickstart.sln" (Restore target(s)).
Project "/root/azure/mipsdk-dotnet-file-quickstart-main/MipSdkDotNetQuickstart.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|Any cpu".
Project "/root/azure/mipsdk-dotnet-file-quickstart-main/MipSdkDotNetQuickstart.sln" (1:2) is building "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/MipSdkDotNetQuickstart.csproj" (2:6) on node 1 (default targets).
/usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2101,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that Could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/MipSdkDotNetQuickstart.csproj]
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
  /usr/lib/mono/msbuild/Current/bin/Roslyn/csc.exe /noconfig /Nowarn:1701,1702 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:/root/.nuget/packages/system.runtime.windowsruntime/4.6.0/ref/netstandard2.0/System.Runtime.WindowsRuntime.dll /reference:/usr/lib/mono/4.7.2-api/Microsoft.CSharp.dll /reference:/root/.nuget/packages/microsoft.identity.client/4.24.0/lib/net461/Microsoft.Identity.Client.dll /reference:/root/.nuget/packages/microsoft.informationprotection.file.ubuntu1804/1.8.97/lib/netstandard2.0/Microsoft.informationProtection.dll /reference:/usr/lib/mono/4.7.2-api/mscorlib.dll "/root/.nuget/packages/system.security.cryptography.x509certificates/4.3.2/runtimes/win/lib/net461/System.Security.Cryptography.X509Certificates.dll" to "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/bin/Debug/System.Security.Cryptography.X509Certificates.dll".
  Creating "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/obj/Debug//MipSdkDotNetQuickstart.csproj.Copycomplete" because "AlwaysCreate" was specified.
_copyOutOfDateSourceItemsToOutputDirectory:
  copying file from "/root/.nuget/packages/microsoft.informationprotection.file.ubuntu1804/1.8.97/dotnet/linux2/native/release/libmip_dotnet.so" to "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/bin/Debug/libmip_dotnet.so".
  copying file from "/root/.nuget/packages/microsoft.informationprotection.file.ubuntu1804/1.8.97/build/native/bins/release/x86_64/libmip_protection_sdk.so" to "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/bin/Debug/libmip_protection_sdk.so".
  copying file from "/root/.nuget/packages/microsoft.informationprotection.file.ubuntu1804/1.8.97/build/native/bins/release/x86_64/libmip_file_sdk.so" to "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/bin/Debug/libmip_file_sdk.so".
  copying file from "/root/.nuget/packages/microsoft.informationprotection.file.ubuntu1804/1.8.97/build/native/bins/release/x86_64/libmip_upe_sdk.so" to "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/bin/Debug/libmip_upe_sdk.so".
  Creating directory "bin/Debug/x64".
  copying file from "/root/.nuget/packages/microsoft.informationprotection.file.ubuntu1804/1.8.97/build/native/bins/release/x86_64/libmip_core.so" to "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/bin/Debug/libmip_core.so".
  copying file from "/root/.nuget/packages/microsoft.informationprotection.file/1.8.97/dotnet/win7-x64/native/release/mip_dotnet.dll" to "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/bin/Debug/x64/mip_dotnet.dll".
  copying file from "/root/.nuget/packages/microsoft.informationprotection.file/1.8.97/build/native/bins/release/amd64/libbz2-1.dll" to "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/bin/Debug/x64/libbz2-1.dll".
  copying file from "/root/.nuget/packages/microsoft.informationprotection.file/1.8.97/build/native/bins/release/amd64/libffi-7.dll" to "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/bin/Debug/x64/libffi-7.dll".
  copying file from "/root/.nuget/packages/microsoft.informationprotection.file/1.8.97/build/native/bins/release/amd64/libgio-2.0-0.dll" to "/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/bin/Debug/x64/libgio-2.0-0.dll".
"/root/azure/mipsdk-dotnet-file-quickstart-main/MipSdkDotNetQuickstart.sln" (default target) (1:2) ->
"/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/MipSdkDotNetQuickstart.csproj" (default target) (2:6) ->
(ResolveAssemblyReferences target) ->
  /usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2101,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that Could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [/root/azure/mipsdk-dotnet-file-quickstart-main/mip-sdk-dotnet-quickstart/MipSdkDotNetQuickstart.csproj]
    1 Warning(s)
    0 Error(s)
Time Elapsed 00:00:03.42*

解决方法

该项目是一个 .NET Framework 项目,不能在 Ubuntu 上运行。

这是一项正在进行的工作,我还没有转移到 Azure 示例,所以它是不完整的。不过,它将建立在 Ubuntu 上,因为它是 .NET Core。确保安装自述文件中的依赖项并将应用设置更新为您自己的客户端和租户 ID。

https://github.com/tommoser/mipsdk-dotnetcore-filesdk-sample/

我希望在接下来的几周内发布 1.9 时将其转移到 azure-samples。我还将努力将其他项目更新到 .NET 5。