visual-studio 如何确定为什么 Visual Studio 在构建解决方案时可能会跳过项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1319772/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to determine why visual studio might be skipping projects when building a solution
提问by Matt
I am debugging someone else's work and the solution is quite large. When I try to build the entire thing, several projects within the solution don't build and just skip. Viewing the output window during the build process says:
我正在调试别人的工作,解决方案非常大。当我尝试构建整个事物时,解决方案中的几个项目不会构建而只是跳过。在构建过程中查看输出窗口说:
1>------ Skipped Rebuild All: Project: pr1lib ------
1>------ 全部跳过重建:项目:pr1lib ------
How can I determine why these builds were skipped? I am unable to find additional output.
如何确定跳过这些构建的原因?我无法找到其他输出。
This is with VS2008 and the solution is comprised of c# and c++ code.
这是 VS2008,解决方案由 c# 和 c++ 代码组成。
采纳答案by Tchami
Right click the solution, choose Properties and then Configuration Properties. Here you can choose which projects to build.
右键单击解决方案,选择属性,然后选择配置属性。您可以在此处选择要构建的项目。
[edit]:
See Kdt's comment: ... when I looked in configuration properties ... the project build target was configured for "Mixed Platforms" while the solution was set to build "Any CPU".
[编辑]:
请参阅 Kdt 的评论:...当我查看配置属性时...项目构建目标配置为“混合平台”,而解决方案设置为构建“任何 CPU”。
*When this problem happened to me, The main project only had 'Any CPU' and it set the child dll to 'any CPU' too, however, I'd deleted that profile and left only 'x86'. Picking x86 for just the dll make it start working
[/edit]
*当这个问题发生在我身上时,主项目只有“任何 CPU”,它也将子 dll 设置为“任何 CPU”,但是,我删除了该配置文件,只留下了“x86”。只为 dll 选择 x86 使其开始工作
[/edit]
回答by Sharon Ben-Avraham
I just had the same problem- "unload project" and "reload project" solved the issue !
我刚刚遇到了同样的问题——“卸载项目”和“重新加载项目”解决了这个问题!
回答by user1325179
Build, rebuild, and clean operations were being skipped. Unloading and reloading didn't help, and neither did restarting Visual Studio.
正在跳过构建、重建和清理操作。卸载和重新加载没有帮助,重新启动 Visual Studio 也没有帮助。
Once I removed the project from the solution and added it back, it is no longer skipped. To remove it, in Solution Explorer, right-click the project > Remove > OK. To add it back, in Solution Explorer, right-click the solution > Add > Existing Project and select your project
一旦我从解决方案中删除了该项目并将其添加回来,它就不再被跳过。要删除它,在解决方案资源管理器中,右键单击项目 > 删除 > 确定。要重新添加它,请在解决方案资源管理器中,右键单击解决方案 > 添加 > 现有项目并选择您的项目
回答by Dave
If the confixguration is x64 and the x64 compiler isn't installed it will skip the project.
如果配置是 x64 并且未安装 x64 编译器,它将跳过该项目。
回答by Andrey K.
My solution is the same as mentioned previously: Delete -> Add existing project
我的解决方案和前面提到的一样:删除->添加现有项目
Butthis solution implies that references between projects get gone
但是这个解决方案意味着项目之间的引用消失了
To avoid re-adding references:and in case if you use version-control systemlike GIT or TFS or whatever, it is possible to acheve goal with the following steps:
为了避免重新添加引用:和的情况下,如果你使用版本控制系统像GIT或TFS或什么的,就可以通过以下步骤acheve目标:
Make shure that all the changes are commited / checked-in before the operation
Go through all projects deletting them from solution and adding-existing them
Notice that the .sln file has changed
Keep the new .sln file, but undo the changes to all the .cspoj files with the version-control system
确保在操作之前提交/签入所有更改
浏览所有项目,从解决方案中删除它们并添加现有的它们
请注意 .sln 文件已更改
保留新的 .sln 文件,但使用版本控制系统撤消对所有 .cspoj 文件的更改
回答by Anish A R
The visual studio 2008 , it can be because 64 bit compiler wouldn't have installed.
在 Visual Studio 2008 中,可能是因为未安装 64 位编译器。
Control Panel --> Programs and Features -> Microsoft Visual Studio 2008 professional --> [double click]
控制面板--> 程序和功能-> Microsoft Visual Studio 2008 专业版--> [双击]
On Visual Studio Dialog
在 Visual Studio 对话框中
Next --> Add/ remove Features --> (Under) Visual C++ --> (select) x64 compiler and Tools
Next --> Add/ remove Features --> (Under) Visual C++ --> (select) x64 compiler and Tools
回答by Mark Alsip
Problem exists in VS 2010 as well; of the proposed solutions: editing build config, cleaning, changing/re-changing target framework, do NOT work. But unloading and reloading the project does.
VS 2010 中也存在问题;建议的解决方案之一:编辑构建配置、清理、更改/重新更改目标框架,不起作用。但是卸载和重新加载项目确实如此。
回答by Sergey Malgin
Hey, just fixed this one. Thought it might help. You most likely didn't install corresponding compilers along with the visual studio. This happened to me today - by default, VS 2008 installer doesn't install x64 C++ compiler.
嘿,刚修好这个。认为它可能有帮助。您很可能没有在 Visual Studio 中安装相应的编译器。这今天发生在我身上 - 默认情况下,VS 2008 安装程序不安装 x64 C++ 编译器。
If you have SP1, uninstall it before changing VS installation. When done, install SP1 again.
如果您有 SP1,请在更改 VS 安装之前将其卸载。完成后,再次安装 SP1。
回答by 1800 INFORMATION
Go to the build menu and choose "configuration manager". This will show which projects are configured to build in your selected configuration.
转到构建菜单并选择“配置管理器”。这将显示哪些项目被配置为在您选择的配置中构建。
回答by Timm
i updated to 15.9.11 , ... after some builds, same problem:most projects are skipped (which build a second ago without problems). Unloading/reloading the solution helps always in my case, but it will happen again soon.
我更新到 15.9.11 ,......在一些构建之后,同样的问题:大多数项目被跳过(第二次构建没有问题)。卸载/重新加载解决方案对我来说总是有帮助,但很快就会再次发生。
I have no idea why... except a big bug in VS2017
我不知道为什么......除了 VS2017 中的一个大错误
I checked configuration manager , all checkmarks are set to build.
我检查了配置管理器,所有复选标记都设置为构建。
Maybe, it has something to do with nuget packages, but that is just a guess
也许,它与 nuget 包有关,但这只是一个猜测
The solution has only c++/vcxproj, no csproj. 64 and 32 are installed both
解决方案只有c++/vcxproj,没有csproj。64和32都安装了

