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

Hus*_*man 5 .net msbuild build visual-studio-2015 .net-core

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

在此输入图像描述

  • ClassLibrary1引用 - > Microsoft.Extensions.Caching.Redis
  • ClassLibrary1使用.NETCoreApp 1.0,而Caching Redis使用.NET Standard 1.5

我的问题是当我构建我的解决方案时,似乎ClassLibrary1找不到Redis的dll,因为dll被放置在解决方案目录中的工件文件夹中.

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

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 
Run Code Online (Sandbox Code Playgroud)

第262行:Microsoft.DotNet.Common.Targets

在此输入图像描述

似乎dll是在项目解决方案中的artifacts文件夹目录中构建和放置的.该项目的File System Struture是:

在此输入图像描述

Cahing项目中没有任何bin文件夹,我如何更改它以在相应的项目中生成垃圾箱?

Hus*_*man 5

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

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


<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\</OutputPath>
Run Code Online (Sandbox Code Playgroud)

我将它们都更改为指向其项目文件夹目录

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

  2. OutputPath - > .\bin\

然后,classLibrary1现在可以找到所需的引用dll.