error MSB4018: System.InvalidOperationException: PE image does not have metadata.
See original GitHub issueSteps to reproduce
Failure is happening when I try to dotnet restore
a .csproj
with the following packages (inside a docker container):
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.2.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
<PackageReference Include="Moq" Version="4.7.63" />
<PackageReference Include="Akka.MultiNodeTestRunner" Version="1.3.10" />
<PackageReference Include="Akka.TestKit" Version="1.3.10" />
<PackageReference Include="Akka.TestKit.Xunit2" Version="1.3.10" />
</ItemGroup>
If I remove package <PackageReference Include="Akka.MultiNodeTestRunner" Version="1.3.10" />
the process goes correctly, so it must be something related to it.
Expected behavior
Some packages download normally, and it finishes with this error:
error MSB4018: System.InvalidOperationException: PE image does not have metadata.
(followed by many other errors.
Another error happens just before this one: /usr/share/dotnet/sdk/2.1.200/Microsoft.Common.CurrentVersion.targets(2106,5): error MSB4018: The "ResolveAssemblyReference" task failed unexpectedly.
Actual behavior
Environment data
dotnet --info
output:
.NET Command Line Tools (2.1.200)
Product Information: Version: 2.1.200 Commit SHA-1 hash: 2edba8d7f1
Runtime Environment: OS Name: ubuntu OS Version: 18.04 OS Platform: Linux RID: ubuntu.18.04-x64 Base Path: /usr/share/dotnet/sdk/2.1.200/
Microsoft .NET Core Shared Framework Host
Version : 2.0.7 Build : 2d61d0b043915bc948ebf98836fefe9ba942be11
(I tried with dotnet core 2.2, but the same happens)
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@igormcoelho Thanks for reporting this to us! I’m resolving this as an external issue. It does not appear to be possible to use
Akka.MultiNodeTestRunner
from non-Windows platforms. Please open an issue with the Akka.NET repro and reference the comment above.A simple repro would be:
I’ll open another issue on MSBuild regarding the RAR task failure.
Thank you!
This is an issue with how
Akka.MultiNodeTestRunner
is packaged.The problem is here. This is copying platform-specific assets into what should be only managed dependencies to reference. Additionally, I see a ton of native files from the framework itself in
lib/netcoreapp1.1
; this suggests that this package also published in a self-contained fashioned.The correct layout for this package should be only managed assemblies to reference (both at compile-time and run-time) in
lib/
and put the native assets intoruntimes/
to copy for run-time only.While we do get a warning for each PE without managed metadata in
lib/netcoreapp1.1
for this package, 16.x MSBuild does fail with an internal error:The RAR task should probably be more resilient to incorrect packages by warning then ignoring any non-managed PEs in
lib/
.