Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetStandard Dependencies #39

Closed
megafinz opened this issue Jun 13, 2017 · 8 comments
Closed

NetStandard Dependencies #39

megafinz opened this issue Jun 13, 2017 · 8 comments
Labels
Milestone

Comments

@megafinz
Copy link

When I try to update SuccincT from 2.3.0 to 3.0.0, I get like 15 new packages as dependencies. Is there a way to avoid that (apart from waiting for NetStandard 2.0 which, I assume, should bring a single package as dependency)?

My app is WPF desktop application that targets .Net Framework.

Maybe this is relevant:
https://stackoverflow.com/questions/42855180/how-to-create-net-standard-nuget-package-with-minimal-dependencies-in-vs-2017

@DavidArno
Copy link
Owner

Oh, that's disappointing and surprising as one of the reasons I went down the dotnet standard route was to simplify dependencies. Doesn't sound like it worked though.

Thanks for the link, I'll take a look.

@DavidArno DavidArno added this to the V3.1.0 milestone Jun 13, 2017
@DavidArno
Copy link
Owner

So according to that link, I need to target both netstandard1.0 and .NET 4.5, and thus create a nuget package with dll's targeting those two. Then .net framework projects use the latter and so do not pull in all the netstandard dependencies!??!? That seems completely broken to me. This only appears to happen if you are using the old-style csproj files s I'm not seeing this in my test-harness.

I can push a v3.0.1 version that does this, but it seems to defeat the purpose of netstandard. So I'll ask around to see if there's a better solution, but will create that new release to tidy things up for you if this really is the only solution.

@megafinz
Copy link
Author

This only appears to happen if you are using the old-style csproj files

Hm, I'll investigate how to upgrade to the new project file format to see if this helps. Things change quite often now, project.json died even before I had a chance to try it.

@megafinz
Copy link
Author

megafinz commented Jun 19, 2017

Seems that new csproj format doesn't work for WPF projects at this moment.
http://www.natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/
dotnet/project-system#1467

I'll try Paket to see if that helps to keep reference list sane.

@DavidArno
Copy link
Owner

@megafinz,

Microsoft's @terrajobst has kindly provided more details of what's going on with netstandard at the moment, in this answer to that Stack Overflow question you linked to.

Assuming I'm reading that answer correctly, the current choices are:

  1. Accept the extra dependencies that a dotnetstandard library pulls into a framework project,
  2. Target net45 too in the nuget package to prevent those dependencies,
  3. Handcraft the nuspec file to only pull in the dependencies really required,
  4. Wait for netstandard 2.0, which will fix many of these issues.

Option 1 isn't good for you. Option 3 sounds hard and as Immo says, it risks being fragile. So option 2, followed by a new release using option 4 when netstandard 2.0 is released seems the best route. So I'll push out a v3.0.1 version that includes net45 shortly.

@DavidArno DavidArno modified the milestones: V3.1.0, V3.0.1 Jun 20, 2017
@DavidArno
Copy link
Owner

DavidArno commented Jun 27, 2017

@megafinz,

I've pushed a v3.0.1 version to nuget. Would you mind testing it to see if it solves this issue for you, please? If it's OK, I'll then update the docs to make it "public".

@megafinz
Copy link
Author

@DavidArno yep, everything is nice. I created a demo project that targets .Net 4.6.1. SuccincT 3.0.1 brings only one package, SuccincT 3.0.0 adds 46 more packages as dependencies into packages.config.

@DavidArno
Copy link
Owner

Excellent. Docs updated to make v3.0.1 "official".

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

No branches or pull requests

2 participants