我不确定我是否在正确搜索,但我希望我能在这里得到一些指导。
当前设置
我有一个包含两个项目的解决方案:
- Web API项目
- Node.js项目
我正在使用Azure DevOps
,其中包含2个构建
,每个构建都有自己的部署
,分别用于两个项目。每个构建定义仅在各自的项目更新/更改时触发。
这很好!
我注意到每次构建实际上会构建整个解决方案。为了不浪费处理能力,我更喜欢每个项目只构建它们自己的项目,但有一些限制条件。
Web Api项目不依赖于Node.js项目的更改,然而, Node.js 可以 依赖于Web Api的更改。因此,如果Web Api失败,则不希望Node.js进行构建/发布。
目标
我试图设置我的构建定义,以便Web Api构建仅构建Web Api项目。无论它完成还是出现错误,让构建按照正常方式继续。
但是,我希望Node.js项目构建同时构建Web Api和Node.js项目,以便如果Web Api构建失败,则整个构建失败,即使Node.js不会失败也是如此。
我尝试添加一个新的Visual Studio Build task
并仅选择该项目,但我遇到了以下错误:
[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(781,5): Warning : The OutputPath property is not set for project 'MyProject.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='release' Platform='any cpu'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.
我目前正在寻找如何修复这个问题,但我想提出以下问题,以防我走错方向。
问题
- 如何设置构建定义仅构建1个项目?
- 是否应该创建不同的配置而不是我提到的那个配置?
构建定义
merge
中同时更改了两个项目,那么Node.js依赖于WebApi(但反之不成立)。 - RoLYroLLs