How to determine why visual studio might be skipping projects when building a solution - visual-studio

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 ------
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.

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".
*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]

Build, rebuild, and clean operations were being skipped. Unloading and reloading didn't help, and neither did restarting 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

I just had the same problem- "unload project" and "reload project" solved the issue !

Restarting Visual Studio did the trick

If the confixguration is x64 and the x64 compiler isn't installed it will skip the project.

My solution is the same as mentioned previously: Delete -> Add existing project
But this solution implies that references between projects get gone
To avoid re-adding references: and in case if you use version-control system like GIT or TFS or whatever, it is possible to acheve goal with the following steps:
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

I had a weird one that may be worth documenting amongst the other possibilities here..
I'd added a Shared Project to my solution, with code that was used in two or three of the other projects. As you're aware - Shared Projects are just code, and not really a project in the traditional sense.. You can't 'build' a shared project, it's just code that is embedded into the other projects, and then built there.
But somehow my solution file had been updated as if the shared project was it's own thing that needed building. I'm guessing then that any time I was trying to build and I hadn't changed the code in the shared project, then it figured 'nothing has changed, skip those builds'
I found the shared project in the solution.sln file like:
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Api.Common", "Api.Common\Api.Common.shproj", "{EC580471-D78A-4509-AC46-BD565553AD60}"
..which is fine. What isn't fine is that this project also appeared in the GlobalSection(ProjectConfigurationPlatforms) = postSolution like:
{EC580471-D78A-4509-AC46-BD565553AD60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC580471-D78A-4509-AC46-BD565553AD60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC580471-D78A-4509-AC46-BD565553AD60}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC580471-D78A-4509-AC46-BD565553AD60}.Release|Any CPU.Build.0 = Release|Any CPU
I removed those four lines from my .sln file, and now things seem happy again

The visual studio 2008 , it can be because 64 bit compiler wouldn't have installed.
Control Panel --> Programs and Features -> Microsoft Visual Studio 2008 professional --> [double click]
On Visual Studio Dialog
Next --> Add/ remove Features --> (Under) Visual C++ --> (select) x64 compiler and Tools

The first thing you need to do is diagnose why the build is skipping projects. So to get a detailed build output change the verbosity to detailed in the following place in Visual Studio.

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.

I've just had this issue, and was able to resolve it by removing the hidden .vs folder in the topmost folder. After restarting Visual Studio everything worked again.

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.
If you have SP1, uninstall it before changing VS installation. When done, install SP1 again.

Close visual studio
Open the sln file with notepad
delete all of the things like this :
{B546C55D-9321-4FC0-B25C-46844222BEBE}.Debug with
Fakes|x86.ActiveCfg = Debug with Fakes|x86 (there will be a bunch of
them)
4.save the file
5.open visual studio and all better

Go to the build menu and choose "configuration manager". This will show which projects are configured to build in your selected configuration.

I had a similar thing just happen to me. I'm not sure what the problem was, but it would not Clean, Build, Rebuild, etc. I am operating in Visual Studio 2017 and wanted a netstandard2.0 assembly. The issue for me was that somehow the project type was incorrect, maybe I started from a netcoreapp class library, something like that, stuck in the Solution file, I do not recall. Anyway, I backed up the project, created a new netstandard class library project, and factored in the backed up bits, and that fixed it for me. HTH someone.

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.
I have no idea why... except a big bug in 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
The solution has only c++/vcxproj, no csproj. 64 and 32 are installed both

This happened to me in VS 2019, and the solution was to simply restart visual studio.
My build configuration was never modified.

I checked-in my project to source control from one computer and downloaded it to another and it will not build properly there. It will skip building projects and didn't even create the master \Debug folder for outputs.
The solution (VS2019) is to right click on solution and select Configuration Manager.
I saw the build checkbox was not checked for two projects that I was building (shown below). I don't know why they were unchecked but checking them and building project worked!

Right click on solution ->Remove then Add the existing project, this worked for me.

Had the same problem, found out that the project setting was for Itanium CPU, changing it to Intel fixed it.

Was running into the same problem with VS2005, all the configurations were correct .
It was even skipping the Clean project command.
Finally Unloading /Reloading did the magic.

Right click on Solution at at your solution explorer, then, click on Property at bottom of the menu. In the property windows, click on Configuration Properties -> Configuration on the left pane, you will see the list of projects on right pane, make sure Build check box is checked in the popup window.

If your solution contains a NuGet project (*.nuproj) file, try unloading it and then rebuilding your solution.
This worked for me after none of the above worked.

I had similar problem, I had one project which could not load in solution explorer due to some reason. When I loaded that project it worked like a charm.

I find that sometimes when you have target platform as set to lets say x86 in your solution and in your projects the project does not actually always had it selected.
To double check go to the project properties and see if you can select that platform in the Build->Platform setting if you can not then you will need to go to the configuration manager and create that configuration.

I had this problem with some Windows CE projects on a new PC. "Unload project" and "Reload project" appeared to fix the problem, but actually Visual Studio had simply switched to a different platform and built that.
It turned out that although my WinCE platform was shown as the active platform, Visual Studio didn't "really" see it. The solution was to reinstall the WinCE SDK with administrator priveleges:
Make sure Visual Studio 2008 is not running.
Open a “Visual Studio 2008 Command Prompt” as Administrator. On Windows 7 just right click the short cut and pick the “Run as administrator” option.
Enter the following command: msiexec /log SDKInstallLog.txt /package <the path to your .msi file>
When asked if you wish to do a custom or complete install pick custom, and instruct the installer to omit the installation of the documentation (this step was not necessary in my case; in fact I just asked it to "repair" the existing installation.)
Install

VS 2008 will skip x64 targets if you don't have the x64 compiler installed. VS 2008 does not by default. Kind of a duh, thing.

I had a very similar issue after generating a project from a decompiler from Telerik, then trying to recompile it. The project was skipped whenever I tried to rebuild it. Tried a lot of the suggestions above, but for me, it was the .NET Framework selected in the project properties.
Right-click project in solution file, select properties, application tab, change target framework from 4.0 to 3.5.
Then, rebuild, and I got a bunch of assembly reference missing errors, which makes sense since I haven't added references to them yet.

I update one small update of Visual Studio 2017 and then the installer reminds me to restart my computer,but I did not restart.When I build my project or solution in Visual Studio 2017,I meet the same above problem.I guess the update maybe the key,so I restart my computer,I did it.:>

I had this problem in Visual Studio 2017 15.9.4 and after some searching and putting some time I found out that in my solution the .csproj file of one of projects got corrupted after merging in TFS. (I could build other projects by unloading the problematic project from solution).
How I resolved my problem was that I compared the .csproj file before and after the merge and do fix that. And by fix I mean since my own project's type was .netStandard I removed unnecessary lines including Configuration PropertyGroup, all and others in the new .csproj file to make it similar to previous .netstandard-style version.

Related

Diagnosing why Visual Studio skips building a project

I have a large solution of dozens of projects. Since yesterday (and for no good reason that I can find) the projects are refusing to build, with Visual Studio's build output window simply stating (eg)
1>------ Skipped Rebuild All: Project: Api.Models.Common ------
There are already a few similar q/a's here about the reasons why VS may decide to skip a build (Configuration not set to build, or set to build wrong target). I'm not interested in guesses as to why this isn't building. I'd really like answers to help me diagnose this, and have Visual Studio tell me why it thinks it can skip the build.
Is there a way to have VS generate anything more detailed than Skipped rebuild for example? It must be calling msbuild under the covers right? So can I have Visual Studio pass additional parameters to msbuild so that it generates diagnostic log output?
(For what it's worth - calling msbuild from the command line builds the projects as expected, so it seems like my issue is something quirky that VS is doing).
I'm using VS 2017 - 15.9.4
If you have any unload projects, you must load it or you remove it in solution.
Note: My unloaded project was the result of a permission issue. VS warned that a project was configured to use IIS. To run the project with IIS required launching VS as an administrator.
This was happening in my solution with Visual Studio 2019. I just migrated my applications from .Net Framework 4.6 to .NET5, almost all the projects were not building, it gets always skipped. The reason was that after the migration the tool upgrade assistant was not setting the Target Framwework as in the preceding image (Right-click on the project and then click on Properties).
After setting it to the right framework, in my case, it was .NET 5.0, the project started to build.

Visual Studio 2010 F5 Debugging C++ is not Rebuilding

I have a Visual Studio 2010 Ultimate C++ project (not managed or .NET). When I press F5 (i.e., start debugging), I want it to save all the files, rebuild those that changed, link the whole thing, and then run. Instead, it appears to use the last build. Thus, when I try to step into a function or something, I get the following error:
Based on my research, I have verified these options, the first three of which are in the Options dialog (can be reached under "Debug->Options and Settings"):
"Projects and Solutions->Build and Run->Only build startup projects and dependencies on Run" is checked. Some research indicated that it should be unchecked, but in my case I actually do only want it to rebuild the startup project. For what it's worth, I've tried unchecking it, with no effect.
"Projects and Solutions->Build and Run->On Run, when projects are out of date:" is set to "Always build".
"Debugging->Edit and Continue->Enable Edit and Continue" is checked, though it's greyed out.
In the Configuration Manager ("Build->Configuration Manager"), all solution configurations and platforms have their "Build" checkbox checked.
I have also tried deleting all Debug and Release directories as well as the .sdf and ipch directory.
For completeness, I suppose I should mention that I'm using precompiled headers, though I kinda doubt it matters.
[EDIT: I should note that it only seems to be one file (a .h file) that's doing it. I tried renaming it and recompiling, and also removing it from the solution and adding it back in, but it didn't work. ]
I was able to bring my solution back into the right state after deleting all .suo and .csproj.user files. Answer led to this solution. Hope this saves someone time.
I fell into this state after installing Ultimate over Professional and running profiling tools.
Once I had similar problem with my C# project and I think I have tried every possible suggestion available on internet but none worked and then this is what I have done:
Created an empty Project
Added startup function to verify that it does not show any error
Imported all my source code manually one by one
So, Yes, it was the solution. You already have done a lot so I would say you can get lucky by trying here and there however having a new project and importing your individual source file would be faster.
Another solution could be that switching the platform. I noticed that when I when to project properties, the new project I had just created had a platform of 'win32' and my other projects in the same solution had it set at x64. After I switched my project to x64, everything worked just fine. This worked for my interop(C,C+, C#) project and hopefully works for other projects as well.
I have successfully resolved it, try the following:
remove all temporary and intellisense files
remove all project from solution and then add them back(most important)
check projects 'Frameworks and References' to ensure they are valid

How to rebuild ALL?

In Visual Studio, how do I rebuild a complete solution, including all configurations?
If I choose "Rebuild solution", it always rebuilds ONLY Debug or ONLY Release, but never both.
Use the batch build option...right click on the solution to see it.
Here is a screen shot (VS2010 but I believe it's the same for VS2008 too)
Batch build screen shot http://img368.imageshack.us/img368/1516/batchbuild.jpg
Some of my project had the 'batch build' option, others didn't.
Found that those that did have it were written in c#.net and those that didn't have it were in vb.net, more information here:
https://msdn.microsoft.com/en-us/library/jj651644.aspx
You can build most types of projects with multiple, or even all, of their build configurations at the same time by using the Batch Build dialog box.
However, you can't build the following types of projects in multiple build configurations at the same time:
Windows 8.x Store apps built for Windows using JavaScript.
All Visual Basic projects.
In Visual Studio 2005, I discovered that under Build->Configuration Manager, I did not have Build checked for the project.

Why does it say "Project with that name already opened in the solution"?

I recently migrated a VSS database to TFS 2008. Using Source Control Explorer, I got the latest version of a solution with 12 projects.
When I opened the solution in VS 2005, two of the projects were not found. I am not sure why these two projects were not found, but thought it easiest to just delete and re-add them to the solution.
When I do this, VS gives me a "A project with that name is already open in the solution." The project doesn't appear in solution explorer, and is not listed in the .sln file.
Any ideas?
I had this problem and I was able to solve it using the following steps:
Remove the project from the solution.
restart visual studio.
add the project to the solution as an existing project.
I had the same message... Seems like it comes from (.csproj) project file. Under first propertygroup there is a section named
<ProjectTypeGuids>...</ProjectTypeGuids>
which generally tells Visual Studio to handle that project in some specific way. Some Guids can be found here.
First make a backup copy of that file. Then removing that section can help you open the project as usual project. As it seems that the Visual Studio thinks that the project is not the type that is specified in the ProjectTypeGuids.
This did it for me:
remove the section <ProjectTypeGuids>...</ProjectTypeGuids> in each project
reopen each project, then save to overwrite the existing project file, finally exit
reopen the solution file
pray (optional)
If anyone uses AnkhSVN instead of TFS, it's also possible, that the .sln-file need the following lines:
GlobalSection(SubversionScc) = preSolution
Svn-Managed = True
Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection
in the "Global" section.
Before anyone tries tempering with their solution- and project files, figure if you may have project dependencies outside the solution, such as IIS - and you forgot to start Visual Studio in Administrator-mode
For me, the project not loaded was because it was configured to use IIS on the local machine and I needed to start Visual Studio as an Administrator.
I have to say that removing the section <ProjectTypeGuids>...</ProjectTypeGuids> could create some problems.
In fact, such a section defines the type of the project and, if removed, could disable some features.
For example, if your project was originally defined as Smart Device (C#), after removing the aforementioned section the on-device debug may not working properly.
Delete .suo file. Build solution. Add Projects.
Unfortunately I don't know the why behind the obtuse error message, I can merely provide what steps I took to get it to go away.
In my case, I had reconfigured my local IIS (<UseIIS> not <UseIISExpress>) and it was no longer hosting the URL that was in the csproj <IISUrl> field.
Editing the .csproj file in another editor and changing that field to the new URL, followed by closing and opening the solution in VS resolved the issue.
I would try hand editing the project/solution files, they are text and pretty easy to read. You can edit the file in notepad. To open up the file as text in visual studio you need to first close the solution. Then do file->open and select the sln file, but instead of hitting the open button, press on the right side where there is an arrow and select open with.. from there you can select source code editor (text).
Somehow VS 2022 doesn't create a virtual directory anymore. I had to manually create the website in IIS
I had the same problem when i migrated a website to a web app project.
Unload the web app.
Add the existing website.
Reload the web app.
The following worked for me when I moved a project running vs2010 to another laptop.
I removed exactly the following and it worked:
<ProjecctType>Guid of sorts</ProjectType>
<SccProjectName>Svn</SccProjectName>
<SccLocalPath>Svn</SccLocalPath>
<SccAuxPath>Svn</SccAuxPath>
<SccProvider>SubversionScc</SccProvider>
For those looking for this while dealing with VSTO projects...
Be sure to have the Office Tools for Visual Studio installed in your machine before opening the project.
I solved it by changing Windows' regional settings. Instead of "English (Europe)", I used "English (United States)". Others have reported similar behaviors with changing for example from "Russian (Ukraine)" to "Russian (Russia)", etc.
-AlessandroSegala
Work For me.
Ref: http://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/customized-cultures-cannot-be-passed-by-lcid-only/26eb9d4b-7ddb-4774-8a40-7a7d84ba9277?auth=1&rtAction=1455534187354
In my case it was corrupted vbproj file. First line was missing:
<?xml version="1.0" encoding="utf-8"?>
After adding this line I had to close the solution, delete .vs folder and open again.
I got it in Visual Studio 2022 version 17.4.4.
You may also see:
Error HRESULT E_FAIL has been returned from a call to a COM
component.
when you try to reload your project.
One way to load the project (and deal with IIS directories later) is to edit the .csproj file and set UseIISExpress to true.
Replace:
<UseIISExpress>false</UseIISExpress>
with
<UseIISExpress>true</UseIISExpress>
Then you need to close your solution and open it again and the project should load.
I encountered this issue with web application projects.
When I tried to reload the projects, the VS2022 output said something like :
"The project is configured to use IIS. Unable to find the server
'{site_url}' on the local computer. Ensure that the local IIS is
configured to handle secure communications."
Which is pretty clear. Indeed, in my case, this was caused by my website https binding that just vanished for no reason (it happened to me several times, looks like a bug with Windows 11 & IIS 10). Things got fixed when I got my https binding back (projects could load norammly).
In VS 2022 to open a legacy web project I had to:
Remove from Solution
Change framework version from 4.6.x to <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> in from csproj
Remove <OutputType>Library</OutputType> from csproj
Close Solution and open it again (!!!)
Add project to the sln again.

Why does one of my project's GUIDs change when I build the project in VS 2005?

For two of my VS 2005 C++ projects, VS wants to write to the .sln file when I build the projects. I have got a number of other VS 2005 C++ projects where this is not the case. It is a problem as due to the fact that we have ClearCase source control integrated with our VS 2005 installations and when we try and run an overnight build via batch files, the build pauses as a ClearCase check out dialog box is displayed.
Looking at what VS is changing in the .sln files, it is the second GUID on the project line.
Before building:
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InterCommClientB", "InterCommClientB.vcproj", "{A2AF232A-7F27-4340-81D5-8ABFD10994D2}"
After building:
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InterCommClientB", "InterCommClientB.vcproj", "{67BE85B7-3234-484E-88FB-4F0E42096583}"
Any help gratefully received. I am new to VS 2005, as we have only recently migrated from VC++ 6.0, so apologies if I have missed something obvious.
We are running VS 2005 Professional Edition, with SP1 installed.
Regards,
Greg.
I had similar problem. It seems that when converting projects from old versions of VS (like 6 or 2003) VS 2010 is not adding Project GUID to the .vcxproj file. Because of that when you open solution including such project VS will recreate GUID for such project, and will change .sln file but will not change .vcxproj file. So another time you open such solution the situation will be the same and the .sln file may change again.
See this: http://connect.microsoft.com/VisualStudio/feedback/details/586258/missing-projectguid-in-vcxproj-files
I am guessing here, but it looks like some changes have been made to the InterCommClientB project(project, not the files in the project). When this happens the sln is updated, in this case only the project GUID.
My best guess to resolve this issue would be to manually build the solution and then checkin the changes. This way the sln file won't change on build.
My second best guess is that you already made this changes at your computer and it is working fine, but you did not get lattest version on the pc where you do the night build .
This might be totally out there - but sometimes Visual Studio fails to check-in a Solution file when it's been modified and while the Solution is open in Visual Studio. Try closing Visual Studio, and only then committing the Solution file.
If it isn't that, there might be some other agency causing the Solution file to need to change the GUIDs its using. In one instance, I was using .NET tools from National Instruments, and they has a licensing scheme that would trigger that sort of action (modification of extraneous files for not good reason) whenever I went to do a rebuild.
Please take a careful look at the output from the build (in the log, or the output window) - you may find some further clues there!

Resources