[英]Several project nuget package. Unable to find package
我要netstandard2.0項目:
項目 A 客戶參考項目 b lib,如:
...
<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 package: dotnet pack projectA/src/client.csproj --configuration Client
.nupkg 包含 lib.dll,但是...
當我嘗試將 package 引用到 projectC 時,我得到projectC.csproj: [NU1101] Unable to find package projectB. No packages exist with this id in source(s): nuget.org
projectC.csproj: [NU1101] Unable to find package projectB. No packages exist with this id in source(s): nuget.org
如何解決?
我發現除了鏈接到的自定義目標之外,我還需要將PrivateAssets="all"
添加到 ProjectReference。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.