I have a project structure like this-
I have created a NuGet package with Project A but when I use this Nuget 'Project A.nupkg', I get an error - Cannot find dependencies 'Project C.dll'.
Project A.csproj is
<PropertyGroup> <TargetsForTfmSpecificBuildOutput> $(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage </TargetsForTfmSpecificBuildOutput></PropertyGroup><ItemGroup><ProjectReference Include="..\ProjectB.csproj"><PrivateAssets>All</PrivateAssets></ProjectReference></ItemGroup><Target Name="CopyProjectReferencesToPackage" DependsOnTargets="BuildOnlySettings;ResolveReferences"><ItemGroup><BuildOutputInPackage Include="@(ReferenceCopyLocalPaths- >WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))->WithMetadataValue('PrivateAssets', 'All'))" /></ItemGroup></Target>
Project B.csproj is
<ItemGroup><PackageReference Include="AWSSDK.Kinesis" version="3.0" /><PackageReference Include="AWSSDK.SQS" version="3.0" /><ProjectReference Include="..\ProjectC.csproj"><PrivateAssets>All</PrivateAssets></ProjectReference></ItemGroup>