sdk: dotnet build reporting "PE image does not have metadata" with no details.

Steps to reproduce

I’m hitting this in a private repro building an assembly building against the full CLR.

Expected behavior

Builds clean or reports the errant image not containing metadatea

Actual behavior

Compilation Succeeds with 0 errors and warnings. Elapsed time is reported. The text “PE image does not have metadata.” is reported and dotnet build exits with 1. The DLL and PDB files are produced and ildasm is able to report metadata for the assembly.

Environment data

dotnet --info output: .NET Command Line Tools (1.0.0-rc2-002444)

Product Information: Version: 1.0.0-rc2-002444 Commit Sha: ada4e363c0

Runtime Environment: OS Name: Windows OS Version: 10.0.14329 OS Platform: Windows RID: win10-x64

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 19 (12 by maintainers)

Most upvoted comments

I just saw this out of nowhere in a Xamarin project. No changes made since the last time it successfully built and deployed. Cleaning and rebuilding fixed it.

We figured out the proper way to pack native assemblies into a nuget package and the problem is solved. 😃

@piotroko I’m seeing this issue again with coreclr 2.0 preview-1. When our nuget package assembly releases a native assembly in the same directory, the following builds fail.

Removing .vs folder and rebuilding app resolved problem in my case (caused by blue screen when debug was running)