如何解决对于包含在文件系统中的项目,Visual Studio 2019 MSBuild 将 $(SolutionDir) 替换为“..”,但不适用于包含在 Git 子模块中的项目
Visual Studio 2019 MSBuild 将 $(SolutionDir) 替换为“..”,用于包含在文件系统中的项目,但不适用于包含在 Git 子模块中的项目。
例如,下面的项目文件(Project0.csproj)有 4 个引用的项目。
- 项目 1 和项目 2 作为 Git 子模块签出。
- 项目 3 和 4 是在与项目 0 相同的存储库中创建的。
它们都以 $(SolutionDir) 开头,但是一旦 VS 构建解决方案,项目 3 和 4 的 $(SolutionDir) 宏就会被替换为“..”
我怎样才能防止这种情况发生?
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\Project1\Project1.csproj">
<Name>Project1</Name>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)\Project2\Project2.csproj">
<Name>Project2</Name>
</ProjectReference>
<ProjectReference Include="..\Project3\Project3.csproj">
<Name>Project3</Name>
</ProjectReference>
<ProjectReference Include="..\Project4\Project4.csproj">
<Name>Project4</Name>
</ProjectReference>
</ItemGroup>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。