Dotnet runtime store: Crossgen can't find the System.Runtime 4.2.2.0

2

I am trying to build the runtime store for my application, optimized for target runtime. However it fails to resolve the System.Runtime, 4.2.2.0 dependency.

My manifest file's contents is as follows:

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

The command is as follows:

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

Output:

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 Info:

.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]

I would like someone to explain me what's going on, why it looks for that exact version of System.Runtime, which doesn't even exist in Nuget, and not 4.3, which is the next matching version.

Is there anything I could do to make it work?

.net-core
.net-core-3.1
asked on Stack Overflow Dec 23, 2019 by kosmakoff

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0