dotnet / dotnet/core

Running "dotnet store" fails in crossgen

Open
#4,031 8 comments 2 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
22k
Forks
4.9k
Avg merge
5d 5h
Merged PRs (30d)
29

Description

I am trying to create the runtime store for my app for linux runtime.

I identified that this minimal manifest won't compile in my environment for target framework `netcoreapp3.1` and runtime `rhel.7.2-x64`.

```xml



```

I use the WSL (Ubuntu) on Windows 10.

Command:

```
dotnet store --manifest ./store_broken.manifest --output ./store_broken_artifacts --framework netcoreapp3.1 --runtime rhel.7.2-x64
```

Output:

```
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Restore completed in 436.43 ms for /mnt/c/Dev/dataart/bcp-dataart/BCP/store_broken.manifest.
Restore completed in 214.5 ms for /mnt/c/Dev/dataart/bcp-dataart/BCP/store_broken.manifest.
Native image /tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.IO.dll generated successfully.
Native image /tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Reflection.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/jg4qy4hg.gcl/Optimize/netcoreapp/crossgen -nologo -readytorun -in "/home/olegk/.nuget/packages/automapper/9.0.0/lib/netstandard2.0/AutoMapper.dll" -out "/tmp/jg4qy4hg.gcl/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/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimeref:/tmp/jg4qy4hg.gcl/Optimize/netcoreapp"" exited with code 33. [/mnt/c/Dev/dataart/bcp-dataart/BCP/store_broken.manifest] Successfully generated perfmap for native assembly '/tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Reflection.dll'.
Successfully generated perfmap for native assembly '/tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.IO.dll'.
Native image /tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Text.Encoding.dll generated successfully.
Native image /tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Runtime.dll generated successfully.
Successfully generated perfmap for native assembly '/tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Text.Encoding.dll'.
Native image /tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Reflection.Primitives.dll generated successfully.
Native image /tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Threading.Tasks.dll generated successfully.
Successfully generated perfmap for native assembly '/tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Runtime.dll'.
Successfully generated perfmap for native assembly '/tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Reflection.Primitives.dll'.
Native image /tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Private.Uri.dll generated successfully.
Successfully generated perfmap for native assembly '/tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Threading.Tasks.dll'.
Successfully generated perfmap for native assembly '/tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Private.Uri.dll'.
Native image /tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Reflection.Emit.dll generated successfully.
Successfully generated perfmap for native assembly '/tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Reflection.Emit.dll'.
Native image /tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Reflection.Emit.ILGeneration.dll generated successfully.
Successfully generated perfmap for native assembly '/tmp/jg4qy4hg.gcl/AutoMapper_9.0.0/runtimopt/System.Reflection.Emit.ILGeneration.dll'.
```

Error suggests that `System.Runtime.dll` cannot be found, however it is found at both paths passed to `crossgen` as `platform_assemblies_paths` parameter.

Inspecting these two `System.Runtime.dll` files I found that they have different versions (and sizes):
* 4.6.24705.1
* 4.700.19.56404

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.