Johan
Johan

Reputation: 53

Nuget package dependency between projects

Let's say that I have 2 class libraries.

I have included a NuGet package in project A. I need to instantiate classes from that package in project B.

Should I simply add references to the package by browsing from project A and point out the dll? Or is there another option?

Upvotes: 1

Views: 1183

Answers (2)

Juan Ignacio Cornet
Juan Ignacio Cornet

Reputation: 239

If you need classes from a package, add the package reference in project B through Nuget Package.

If you just need the classes from project A in project B, then add reference to project A from project B.

Upvotes: 0

Seididieci
Seididieci

Reputation: 404

You can add the same NuGet package in project B and use it.

Package manager in Visual Studio creates a directory inside your SoutionDir called "packages", it contains all NuGet dlls from all projects. So it does not download it 2 times...

Upvotes: 1

Related Questions