question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve implicit .NET standard facade references

See original GitHub issue

If you reference System.Collections.Immutable 1.4.0 in a net462 project, it picks the netstandard2.0 System.Collections.Immutable dll. Unfortunately, the build system copies not just netstandard.dll but all the .NET Standard 1.* facade assemblies as well. This means 72 unreferenced, unused System.* and Microsoft.* DLLs show up for deployment. This is decidedly unpleasant.

Would you please make the SDK smart enough to only add the netstandard1.* assemblies if there is at least one reference to a netstandard1.* assembly? And, independently, add netstandard.dll only if there is at least one reference to a netstandard2.* assembly?

Here is the target which currently lumps both 1.* and 2.* in at once or none at all:

https://github.com/dotnet/sdk/blob/83ba345017d368c80e2d24090a2507a0f4627001/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.NETFramework.targets#L90-L95

This has been the only reason I’ve backed away from using System.Collections.Immutable in many projects.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ericstjcommented, Mar 8, 2018

Yep, that’s correct. In the future you can tag me. Sorry I didn’t see it.

0reactions
livarcocccommented, Sep 20, 2018

Closing as the issue seem to have been addressed and new issues were filed against dotnet/standard.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NET Framework 4.6.1 application has errors referencing . ...
One workaround is to use the NETStandard.Library 1.6.1 package instead. This still has the dependencies on the individual library packages to ...
Read more >
Reference assemblies
Learn about reference assemblies, a special type of assemblies in .NET that contain only the library's public API surface.
Read more >
NET Standard
NET Standard is a formal specification of .NET APIs that are available on multiple .NET implementations. The motivation behind .
Read more >
Some Things I Learned While Getting Started with .NET ...
NET Standard library in Visual Studio I first noticed that there was no references item in the solution explorer.
Read more >
Microsoft Net Architecting Applications For The Enterprise ...
Developer Reference. Exam Prep for Microsoft .NET - Architecting Applications ... Improving .NET Application Performance and Scalability.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found