我有5个项目的解决方案,其中2个是.netstandard 2.0,而3个是.net core 2.1。 这些项目之间的引用如下:
Api
引用了Common
和Models
。Common
没有引用。Common
,“模型”和“接口”。Interfaces
引用了Models
。Models
引用了Common
。我已经将此Api.nuspec
文件添加到了Api.csproj
文件所在的Api项目的根文件夹中:
<?xml version="1.0"?>
<package >
<metadata>
<id>API</id>
<version>1.0.0</version>
<title>title</title>
<authors>Liran Friedman</authors>
<owners>Liran Friedman</owners>
<licenseUrl></licenseUrl>
<projectUrl></projectUrl>
<iconUrl></iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>desc</description>
<releaseNotes>Initial version</releaseNotes>
<copyright>Copyright 2018</copyright>
<tags>api</tags>
<dependencies>
<group targetFramework=".NETCoreApp2.1">
<dependency id="Logic" version="1.0.0" exclude="Analyzers" />
<dependency id="Models" version="1.0.0" exclude="Analyzers" />
<dependency id="Microsoft.AspNetCore" Version="2.1.4" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Authentication" Version="2.1.2" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Authentication.Cookies" Version="2.1.2" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.1.2" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Authorization" Version="2.1.2" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.CookiePolicy" Version="2.1.2" exclude="Build,Analyzers" />
<dependency id="Microsoft.Extensions.DependencyInjection" Version="2.1.1" exclude="Build,Analyzers" />
<dependency id="Newtonsoft.Json" Version="11.0.2" exclude="Build,Analyzers" />
<dependency id="System.IdentityModel.Tokens.Jwt" Version="5.2.4" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>
<files>
<file src="C:\XXX\Api\bin\Release\netcoreapp2.1\Api.dll" target="lib\netcoreapp2.1\Api.dll" />
<file src="C:\XXX\Logic\bin\Release\netcoreapp2.1\Logic.dll" target="lib\netcoreapp2.1\Logic.dll" />
<file src="C:\XXX\Models\bin\Release\netcoreapp2.1\Models.dll" target="lib\netcoreapp2.1\Models.dll" />
</files>
</package>
我正在尝试为项目Api
创建一个nuget包,并将其发布到我们工作网络中的本地共享文件夹中。我尝试了两种方式:
pack
nuget.exe pack Api.csproj -Build -IncludeReferencedProjects -Version 1.0.0 -OutputDirectory O:\Nugets -Properties Configuration=Release;Desc="desc";Authors="Liran Friedman"
当我在本地PC上引用该nuget时,它工作正常,但是当从其他PC上引用该nuget时,会出现错误NU1101
,表明缺少Models' and
Logic`引用。
我在这里做什么错了?