简体   繁体   中英

How to ignore dependencies .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.

在此处输入图片说明

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM