visual-studio - Building only particular project in the Visual Studio solution
问题描述
In Visual Studio (C#) I have a solution with dozens of projects. Let say I have projects: A, B, C, D, E.
Project "C" depends on "A" and "B".
"A" and "B" are not depending on any projects.
In the solution explorer I select project "C", then select "Build" (right mouse click in context menu).
But Visual Studio, along with all information in the output, displays me the list of errors in the projects "D" and "E". I.e it is trying to build other projects too.
But I did not asked for that. I want to build project "C" (also projects "A" and "B" should be built as dependendcies).
Question: How can I build only that project I want (and its dependencies). And turn off this unwanted behaviour, like trying to compile projects which are in the same solution, but are not linked to the project I want to build.
UPDATE
Configuration manager looks like that:
If I understand correctly all projects are marked, because they should be built when I build the whole solution. I think I can unmark all unwanted projects and leave only A, B and C.
And when I will need to build the whole solution, I will need to mark all projects again.
Is it the only solution?
I supposed when I select a project in the solution explorer and build only this project, only this project and its dependencies should be built. Did I miss something here?
解决方案
Go to Project --> Project Dependencies, select the project and then select what projects it depends on.
You may also want to look at the Microsoft Documentation on how to Exclude Projects from a Build. You can create a Custom Build and exclude the projects you don't want from it.
推荐阅读
- c# - SetActive() 只能从主线程调用
- xgboost - xgboost/lightgbm/catboost 背后的想法比较
- java - Android 回调方法未填充列表
- excel - 我可以在 Word 中使用带有特殊粘贴功能的 Excel 表格链接吗?
- nginx-reverse-proxy - NGINX 反向代理重定向而不是代理
- three.js - 如何正确提高 AR.js 处理分辨率?
- javascript - 将 VueJs 模态组件添加到 Laravel 模板
- python - 在 MultiIndexed DataFrame 中随机采样级别
- android - 启动应用时弹出 Android 默认锁屏
- ios - 从外部 xib/nib 文件导入的自定义按钮不响应按钮单击