简体   繁体   中英

DLL present in Nuget but restore failing

I have the following setup

Proj A Proj B Proj C

In Proj D, I added the project reference of Proj A, B and C. And I am packaging the Proj D as nuget. I have already followed the solution here https://github.com/nuget/home/issues/3891#issuecomment-377319939

When I check the nuget package generated, I can see the dlls of Proj A, B and C present in the lib folder. But when I try to add that nuget to my project, it tries to find the nugets of Proj A, B and C from all my feeds and fails.

I am new to this area so not able to figure out what is happening here. Need some help to understand this scenario.

I tested this out and it works as expected from the comment you linked.

Make sure your project references have the metadata PrivateAssets="all" . Otherwise, you will get A, B, and C as NuGet package dependencies of package D.

The original github comment said to do this. It will not work.

<ItemGroup>
  <ProjectReference Include="..\A\A.csproj" Type="project" />
</ItemGroup>

This worked for me (with the custom pack targets).

<ItemGroup>
  <ProjectReference Include="..\A\A.csproj" PrivateAssets="all" />
</ItemGroup>

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