Dotnet运行时存储:Crossgen找不到System.Runtime 4.2.2.0

时间:2019-12-23 10:15:00

标签: .net-core .net-core-3.1

我正在尝试为我的应用程序构建针对目标运行时进行优化的运行时存储。但是,它无法解决System.Runtime 4.2.2.0依赖性。

我的清单文件的内容如下:

<Project Sdk="Microsoft.NET.Sdk">
  <ItemGroup>
    <PackageReference Include="AutoMapper" Version="9.0.0" />
  </ItemGroup>
</Project>

命令如下:

dotnet store --manifest ./store_broken.manifest --output ./store_broken_artifacts --framework netcoreapp3.1 --runtime ubuntu.18.04-x64

输出:

Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 543.01 ms for /mnt/c/Dev/xxxxx/store_broken.manifest.
  Restore completed in 202.77 ms for /mnt/c/Dev/xxxxx/store_broken.manifest.
  Native image /tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Runtime.dll generated successfully.
  Native image /tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.IO.dll generated successfully.
  Error: Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
  Error compiling /home/olegk/.nuget/packages/automapper/9.0.0/lib/netstandard2.0/AutoMapper.dll: Could not find or load a specific file. (0x80131621)
  Error: compilation failed for "/home/olegk/.nuget/packages/automapper/9.0.0/lib/netstandard2.0/AutoMapper.dll" (0x80131621)
/usr/share/dotnet/sdk/3.1.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(148,5): error MSB3073: The command "/tmp/3lf1fntj.wem/Optimize/netcoreapp/crossgen -nologo -readytorun -in "/home/olegk/.nuget/packages/automapper/9.0.0/lib/netstandard2.0/AutoMapper.dll" -out "/tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/AutoMapper.dll" -jitpath "/home/olegk/.nuget/packages/microsoft.netcore.app.runtime.linux-x64/3.1.0/runtimes/linux-x64/native/libclrjit.so" -platform_assemblies_paths "/tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimeref:/tmp/3lf1fntj.wem/Optimize/netcoreapp"" exited with code 33. [/mnt/c/Dev/xxxxx/store_broken.manifest]
  Native image /tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Reflection.dll generated successfully.
  Successfully generated perfmap for native assembly '/tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.IO.dll'.
  Successfully generated perfmap for native assembly '/tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Runtime.dll'.
  Native image /tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Reflection.Primitives.dll generated successfully.
  Successfully generated perfmap for native assembly '/tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Reflection.dll'.
  Successfully generated perfmap for native assembly '/tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Reflection.Primitives.dll'.
  Native image /tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Text.Encoding.dll generated successfully.
  Native image /tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Threading.Tasks.dll generated successfully.
  Successfully generated perfmap for native assembly '/tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Text.Encoding.dll'.
  Native image /tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Private.Uri.dll generated successfully.
  Successfully generated perfmap for native assembly '/tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Threading.Tasks.dll'.
  Successfully generated perfmap for native assembly '/tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Private.Uri.dll'.
  Native image /tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Reflection.Emit.dll generated successfully.
  Successfully generated perfmap for native assembly '/tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Reflection.Emit.dll'.
  Native image /tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Reflection.Emit.ILGeneration.dll generated successfully.
  Successfully generated perfmap for native assembly '/tmp/3lf1fntj.wem/AutoMapper_9.0.0/runtimopt/System.Reflection.Emit.ILGeneration.dll'.

Dotnet信息:

.NET Core SDK (reflecting any global.json):
 Version:   3.1.100
 Commit:    cd82f021f4

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  18.04
 OS Platform: Linux
 RID:         ubuntu.18.04-x64
 Base Path:   /usr/share/dotnet/sdk/3.1.100/

Host (useful for support):
  Version: 3.1.0
  Commit:  157910edee

.NET Core SDKs installed:
  3.1.100 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

我希望有人向我解释发生了什么,为什么它要查找System.Runtime的确切版本,而Nuget中甚至不存在该版本,而下一个匹配的版本不是4.3。

有什么我可以做的吗?

0 个答案:

没有答案