我要netstandard2.0项目:
- 项目A/src/client/client.csproj
- 项目B/src/lib/lib.csproj
项目 A 客户参考项目 b 库,如:
...
<ItemGroup>
<ProjectReference Include="..\..\..\projectB\src\lib.csproj">
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<IncludeAssets>lib.dll</IncludeAssets>
</ProjectReference>
</ItemGroup>
<Target DependsOnTargets="ResolveReferences" Name="CopyProjectReferencesToPackage">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
</ItemGroup>
</Target>
...
我尝试创建 nuget 包:dotnet pack projectA/src/client.csproj --configuration Client
.nupkg 包含 lib.dll,但是...
当我尝试将包引用到 projectC 时,我得到projectC.csproj: [NU1101] Unable to find package projectB. No packages exist with this id in source(s): nuget.org
如何解决?