Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

.Net Standard Library Dependency #3

Closed
ms007 opened this issue Apr 28, 2017 · 6 comments
Closed

.Net Standard Library Dependency #3

ms007 opened this issue Apr 28, 2017 · 6 comments

Comments

@ms007
Copy link

ms007 commented Apr 28, 2017

I like your work.
One thing I noticed is the dependency to the .Net Standard Library.
When I install the nuget package for Pather.CSharp I end up with over 2000 changed files.

Is the .Net Standard Library really required as a dependency?

@Domysee
Copy link
Owner

Domysee commented Apr 29, 2017

Referencing it makes development easier, since I don't have to look for packages to get features that were there by default in "normal" .Net development.
But this shouldn't be an issue, your code should not have to change because of it.
Can you elaborate a bit on what you are doing and why you end up with so many changed files?

@ms007
Copy link
Author

ms007 commented May 1, 2017

We do commit our packages directory and the changed files are mainly from the packages directory.

I've read here that the NETStandard library package should not be referenced by libraries.

It's worth noting that the NETStandard.Library package will typically be referenced by projects, though not by libraries.

but I have to confess that my knowledge about Net Standard is modest and I don't know what the best practices are.

@Domysee
Copy link
Owner

Domysee commented May 1, 2017

Thanks for that reference.
It seems you are right, I'll change the dependencies in the next version.

Domysee pushed a commit that referenced this issue May 8, 2017
Now, only the packages that are really needed are referenced. The metapackage DotnetStandardLibrary is not referenced any more.
@Domysee
Copy link
Owner

Domysee commented May 8, 2017

This issue is now fixed with version 2.0.4.
Just if anybody is interested, it seems that Microsoft wants to push the NETStandard.Library package. As described in the csproj reference, the package is implicitly referenced:

Since Microsoft.NETCore.App or NetStandard.Library metapackages are implicitly referenced, ...

However, I still agree that referencing as little as possible is the way to go.

It is possible to disable that implicit reference by adding a DisableImplicitFrameworkReferences element with True as content, as I have now done, but it is not documented in that docs page.
If found that on a Stackoverflow question and then a bit more information on a ticket on the dotnet sdk.

@Domysee Domysee closed this as completed May 8, 2017
@dsplaisted
Copy link

dsplaisted commented May 10, 2017

You could disable the NETStandard.Library dependency from being included as a dependency of your NuGet package without disabling the implicit reference entirely with the following:

<ItemGroup>
    <PackageReference Update="NETStandard.Library" PrivateAssets="true" />
</ItemGroup>

This will happen automatically when targeting .NET Standard 2.0 or higher: dotnet/sdk#1171

@Domysee
Copy link
Owner

Domysee commented May 12, 2017

Thank you, @dsplaisted, this way seems more straightforward.
But is there any difference to using DisableImplicitFrameworkReferences?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants