NuGet无法直接安装本地.nupkg包,
只能通过NuGet源安装。
在当前目录新增一个NuGet.Config文件
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="local-packages" value="../foo/bin/Debug" />
</packageSources>
</configuration>
或者在 .NET Core 2.0 tools / NuGet 4.3.0 环境下, 也可以在 csproj 文件中增加 NuGet:
<PropertyGroup>
<RestoreSources>$(RestoreSources);../foo/bin/Debug;https://api.nuget.org/v3/index.json</RestoreSources>
</PropertyGroup>
之后通过dotnet命令安装包
dotnet add package packagename
(optionally add-v 1.0.0
)dotnet restore
dotnet run