UndeadEmo
UndeadEmo

Reputation: 523

How to ignore dependencies for .NET Core during NuGet packaging?

I have my own NuGet packages located on a disk (local Nuget). I'm trying to not add the same DLL multiple times and get in a scenario like the image attached

I have tried the following code during packing but doesn't work

dotnet pack PathtoSolution\SystemCore.Services.Data --no-dependencies --output "G:\NuGetPackages"

However, during restoration to another project, the dependency comes back.

enter image description here

Is there a way to not include dependencies during the packing process or is ignoring at installation time my only option?

Upvotes: 0

Views: 404

Answers (1)

Michael Brown
Michael Brown

Reputation: 1718

You can add to your PackageReference PrivateAssets="all" - however this has some undesirable effects as well as you won't be able to access the types defined in those assemblies outside of your nuget package. If that's ok with you, it would work.

Upvotes: 1

Related Questions