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

[Question] - What does the "imports" mean in frameworks project.json? #1540

Closed
dazinator opened this issue Jun 3, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@dazinator
Copy link

commented Jun 3, 2016

I'm confused about the new format in RC2 project json.

What does this actually mean?


 "frameworks":  {

    "net451":  {},

    "netstandard1.5":  {

      "imports":  [

        "dotnet5.6",

        "dnxcore50",

        "portable-net45+win8"

            ]

        }

    },

I am assuming it means that my library / app will be built against 2 frameworks, net451 (.NET 451 desktop?) and "netstandard1.5" profile.

However what's the "imports" bit about and what does it do specifically? Where can I learn more about it? Does it mean that my assembly / library will not only have compatibility with netstandard, but also the other "imports"? If so that's odd as that would kind of be implied right by targeting netstandard anyway?

Also if I am targeting netstandard1.5 does that mean I can drop net451?

Cheers

@dazinator dazinator changed the title [Question] - What does this mean? [Question] - What does the "imports" mean in frameworks project.json? Jun 3, 2016

@moozzyk

This comment has been minimized.

Copy link
Contributor

commented Jun 3, 2016

imports enables using packages that have not been updated to use new monikers. It is like telling "trust me - dotnet5.6, dnxcore50 etc. packages will work if I target netstandard1.5". As a result NuGet will not fail to restore if a package does not target the target TFM if it targets one of the imported TFMs. You need to be careful though - you may get runtime errors if your imports enable importing incompatible packages. You should see fewer import once more NuGet packages are converted from old TFMs to new TFMs.

@dazinator

This comment has been minimized.

Copy link
Author

commented Jun 3, 2016

@moozzyk ahh I see. That makes sense. Is there a place we can see which TFM's are fully compatible with netStandard? I'm assuming "dotnet5.6", "dnxcore50", and "portable-net45+win8" are all fully compatible and wont lead to runtime errors but assumptions are the mother of all **** ups so they say!
:-)

@moozzyk

This comment has been minimized.

Copy link
Contributor

commented Jun 3, 2016

I don't have a list like that. I think that you actually should start without any imports try to restore packages and see which packages fail to restore (typically the one that fails is JSON.NET - only the version 9.0.1-beta1 which was released a few days ago support netstandard and packages shipped in RC2 all depend on version 8.0.3 or older hence the need for imports) and then you crack open the package and check what TFMs it supports and add imports based on this. I think "dotnet5.6", "dnxcore50" are safe bets.

@dazinator

This comment has been minimized.

Copy link
Author

commented Jun 3, 2016

Ok thanks a lot ;)

@dazinator dazinator closed this Jun 3, 2016

jkotalik pushed a commit that referenced this issue Nov 1, 2018

ryanbrandenburg pushed a commit that referenced this issue Nov 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.