I have .NET Core class libraries I publish to NuGet. After upgrading them to VS 2017 csproj format, they have the following signature.
<Project Sdk="Microsoft.NET.Sdk">
...
</Project>
Adding Microsoft.NET.Sdk
seems to add references to a base set of libraries. However, as a library author myself, I probably want to only references a minimum set of references. Is that still true and if so, how can it be achieved?
Looking at the ASP.NET Core and Entity Framework Core projects, they seem to use Microsoft.NET.Sdk
and do not individually select just the packages they need.
Update
I raised issue dotnet/cli #5994 on GitHub and @davidfowl said:
The new guidance is to reference NETStandard.Library always as a package author.
However, he's not gone into detail as to why?
You can set
<PropertyGroup>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
In your .csproj. This tells the SDK to not reference NETStandard.Library or Microsoft.NETCore.App implicitly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With