如何告诉MSBuild在ProjectReference中搜索不同的输出目录?

时间:2018-06-16 00:42:06

标签: msbuild

我有一个带有ProjectReference的csproj文件

<ProjectReference Include="..\some.other.proj\Some.Other.Proj.csproj">
  <Project>{E4CE1A80-7A34-43B8-BC8F-33A50693FA49}</Project>
  <Name>Some.Other.Project</Name>
</ProjectReference>

In Some.Other.Proj.csproj我有

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<OutputType>Library</OutputType>
<AssemblyName>Some.Other.Project</AssemblyName>
</PropertyGroup>

我也将OutDir设置为%ROOT%\ out \ debug

问题在于,当我构建项目时,我收到一条错误,指出无法找到%ROOT%\ out \ debug \ some.other.proj \ Some.Other.Project.dll。那是因为它被构建到%ROOT%\ out \ debug \ Some.Other.Project \ Some.Other.Project.dll中。输出文件夹是我想要的,但ProjectReference没有正确找到它。到目前为止,我发现的唯一解决方案是添加一个OutDirSuffix项目,该项目强制Some.Other.Project构建到%ROOT%\ out \ debug \ some.other.proj。我不想这样做,有没有办法设置ProjectReference期望的目录?

0 个答案:

没有答案