Reference metadata is not preserved by ImplicitlyExpandNETStandardFacades
See original GitHub issueFor a project targeting .Net Framework 4.7.1 with a reference to netstandard libraries, the target ImplicitlyExpandNETStandardFacades
replaces certain references with their Facades so netstandard based assemblies work as expected. This currently works great if the project does not associate metadata(like aliases) with any of these references, but when it does - those aren’t honored breaking build.
Filing this issue to ensure that the missing metadata is preserved when the replacement is done.
Adding few more details, here is the reference in question:
<ReferenceInclude="System.Net.Http">
<HintPath>E:\SomeRandomProjectPath\bin\debug\System.Net.Http.dll</HintPath>
<Aliases>snh</Aliases>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
and here is what is passed on to csc:
E:\Program Files (x86)\Microsoft Visual Studio\15.7Prev\Enterprise\MSBuild\15.0\bin\Roslyn\csc.exe /noconfig /unsafe+ /nowarn:1587,1591,1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"E:\Program Files (x86)\Microsoft Visual Studio\15.7Prev\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net471\lib\System.Net.Http.dll ...."
Notice the missing alias to System.Net.http.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Microsoft.NET.Build.Extensions.NETFramework.targets
However, we want to preserve custom metadata on those simple name references (for example for aliases). That's what this task does.
Read more >NETSDK1130: Can't reference a Windows Metadata ...
How to resolve the issue of not being able to reference a Windows Metadata component directly from an app that targets .NET 5...
Read more >"ReferencePath" does not define a value for metadata ...
Right click on 'References' in the project solution -> select 'Migrate ... "ReferencePath" does not define a value for metadata "CopyLocal".
Read more >UWP IL2CPP GameAssembly missing
I have ported a .net to il2cpp backend and I can't get any of my projects to work. 1>LINK : fatal error LNK1104:...
Read more >out.txt
Honor SkipGetTargetFrameworkProperties=true metadata on project references to mean that the project reference is known not to target multiple frameworks and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For reference, the workaround posted for the Fakes issue is to put the following in Directory.Build.targets:
@entei-11 Yes, this fix is only available in the .NET Core SDK 3.0.100 and higher, which only works with VS 2019.