Visual Studio 构建错误 -> Microsoft.DotNet.Common.Targets: 找不到 DLL

Visual Studio Build Error -> Microsoft.DotNet.Common.Targets: DLL could not be found

我正在使用 Visual Studio 2015 Update 3,我正在使用 NET Core,我有三个 class 库。这是我的 class 个库:

我的问题是,当我构建解决方案时,ClassLibrary1 似乎找不到 Redis 的 dll,因为 dll 位于解决方案目录的 artifact 文件夹中。

如果我检查构建输出,它会说:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5)


 error : C:\Caching-1.0.0\src\ClassLibrary1\error CS0006:
 Metadata file 'C:\Caching1.0.0\src\Microsoft.Extensions.Caching.Redis\bin\Debug\netstandard1.5\Microsoft.Extensions.Caching.Redis.dll'
 could not be found 

第 262 行:属于 Microsoft.DotNet.Common.Targets

dll 似乎已构建并放置在项目解决方案的 artifacts 文件夹目录中。项目的文件系统结构是:

Cahing 项目中没有任何 bin 文件夹,如何更改它以在其对应的项目中生成 bin?

我检查了缓存项目的 xproj 文件,它包含构建信息,它将输出重定向到工件文件夹:

<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj$(MSBuildProjectName)</BaseIntermediateOutputPath>


<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\</OutputPath>

我把它们都改成了指向它的项目文件夹目录

  1. BaseIntermediateOutputPath -> .\obj$(MSBuildProjectName)

  2. OutputPath -> .\bin\

那么,classLibrary1现在就可以找到需要引用的dll了。