0

In project.json now we can specify different frameworks. Now the complexity is increased due to the several options to target. You may fill framework, runtime and dependencies fields making the system much more flexible but so much complex too specially now that exist a new target called netstandard.

Each framework and dependency can have other fields too, one that takes my attention is import. I have seen different examples using differently but I dont know its effect. In addition I have run in trouble playing with that.

Can someone turn one light about that?

Athari
  • 33,702
  • 16
  • 105
  • 146

1 Answers1

0

The imports property is used when you want to reference some packages that don't seem to be compatible with the current framework, but you know that they actually are.

This is mostly useful when your framework is netcoreapp or netstandard and you want to reference a package that doesn't have a netstandard version yet, but either has a version that uses an old version of .Net Core (dnxcore50, but such packages should be very rare now) or has a PCL version (portable-*).

If you're not in such situation, you should not use imports. You definitely can run into trouble if you use it improperly, it's there for those "I know what I'm doing, trust me" cases.

svick
  • 236,525
  • 50
  • 385
  • 514