Closed CheloXL closed 1 year ago
I can definitely repro this bug in the manner you suggested: add a package ref then run that code. Writing a unit test though does not reproduce this bug. Looking at the binaries the resource is available when I build locally but not in the official package. That doesn't make a lot of sense though because the code to embed the resource is static ...
<EmbeddedResource Include="$(NuGetPackageRoot)\microsoft.netcore.app.ref\7.0.0-rc.1.22426.10\ref\net7.0\System.Reflection.Metadata.dll">
<LogicalName>net70.System.Reflection.Metadata</LogicalName>
<Link>Resources\net70\System.Reflection.Metadata.dll</Link>
</EmbeddedResource>
At the moment I don't have a good idea on how this could happen other than maybe Linux restore has a subtle different behavior here which causes this. Even if that were true though I would expect a build error, not a silent failure.
Going to have to debug this a bit.
Indeed the build on Linux silently removes this resource.
Quite puzzling.
This is the root cause https://github.com/dotnet/msbuild/issues/9152
Fixde in 1.4.5. Thanks for reporting! That was a tough one to track down .
Thank you for taking the time to fix this!
I have a project where I'm using Basic.Reference.Assemblies.Net70 1.4.2, that uses Microsoft.CodeAnalysis.CSharp to compile some on the fly created classes. After updating it to 1.4.4, I'm starting to get the following error:
The method where that error is thrown looks like the following:
Reverting back to 1.4.2 solves the problem. Not sure what was changed between 1.4.2 and 1.4.4, but something broke.