Open kosmakoff opened 4 years ago
I've encountered similar errors. In my case, dotnet store
installs System.Runtime 4.3.0
from NuGet.org in Restore
target, and _RestoreCrossgen
copies 4.3.0 binary to the temporary directory to optimize.
However, a DLL that built with 3.1.1, it requires 4.2.2, which is not compatible with 4.3.0, it fails to build.
It is related to the crossgen optimizer, so --skip-optimization
can be a workaround of it. (However, it triggers another bug C:\Program Files\dotnet\sdk\3.1.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ComposeStore.targets(345,5): error MSB3094
which involves with a package with multiple dlls)
I think there should be dotnet 3.1.1 runtime path in the $(CrossgenPlatformAssembliesPath)
which is passed to the crossgen or dotnet 3.1.1 runtime libraries should be copied to the $(CrossgenPlatformAssembliesPath)
Skipping optimization helped me, but it completely defeats the point - I wanted these DLLs optimized for target environment.
I understand that crossgen binaries is not considered public API, therefore it should either work perfectly, or at least report errors that we would know how to fix on our end.
@jashook @safern is this something you can help with? Thanks.
@davidwrighton is this something your team can help with this?
I'm not familiar with dotnet store, but @mangod9 can probably assign someone to research this.
Yeah I can have someone investigate. @kosmakoff are there specific repro steps for this?
@mangod9 I've just tried those steps from the initial post, and they are still valid, i.e. dotnet store
fails on them.
Have Ubuntu 18.04.3 LTS installed in WSL2 in Winows 10. On top of that there is a dotnet SDK version 3.1.100
.
Create the file named store_broken.manifest
with following contents.
<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 rhel.7.2-x64
.
After upgrading the dotnet
tool via official instructions from this page dotnet reports version 3.1.101 but the issue remains.
Interestingly enough, if I choose to upgrade the Automapper to it's latest (to 10.0.0
) then dotnet restore
works flawlessly. So it must be something with the version 9.0.0 of the package that the dotnet restore
fails to process correctly.
Same problem here with the official mcr.microsoft.com/dotnet/core/sdk:3.1
docker image. I am using --runtime linux-x64
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 runtimerhel.7.2-x64
.I use the WSL (Ubuntu) on Windows 10.
Command:
Output:
Error suggests that
System.Runtime.dll
cannot be found, however it is found at both paths passed tocrossgen
asplatform_assemblies_paths
parameter.Inspecting these two
System.Runtime.dll
files I found that they have different versions (and sizes):