正在为一个项目(A.csproj),它依赖于另一个项目(B.csprojec)添加作为项目引用创建的NuGet PKG。
这里是.nuspec,
<?xml version="1.0"?>
<package >
<metadata>
<id>A.Client</id>
<title>A.Client</title>
<description>HttpClient and Models for calling the A Microservice.</description>
<version>1.0.2</version>
<authors></authors>
<owners></owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>.</copyright>
<tags></tags>
<dependencies>
<group targetFramework=".NETFramework4.5">
<dependency id="Newtonsoft.Json" version="9.0.1" exclude="Build,Analyzers" />
// <dependency id="B" version="1.0.0"/> tried this but same error
</group>
<group targetFramework=".NETStandard2.0">
<dependency id="Newtonsoft.Json" version="9.0.1" exclude="Build,Analyzers" />
// <dependency id="B" version="1.0.0"/> tried this but same error
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Net.Http" targetFramework=".NETFramework4.5" />
</frameworkAssemblies>
</metadata>
<files>
<file src="bin\$configuration$\netstandard2.0\A.dll" target="lib\netstandard2.0" />
<file src="bin\$configuration$\net45\A.dll" target="lib\net45" />
</files>
</package>
我用了
nuget pack A.nuspec -Properties configuration=debug
生成程序包。 然而,当我试图消耗这个包里面c.csprojc,我得到以下错误
Severity Code Description Project File Line Suppression State
Error NU1101 Unable to find B. No packages exist with this id in source(s): Local Package source, Microsoft Visual Studio Offline Packages, nuget.org, Package source
我错过了什么 ?