Visual Studio 2012 not building dependent projects

25,545

Solution 1

Your symptoms sound very similar to those I experienced a while ago. Ensure that the projects are set to build with your current active solution configuration and active solution platform under Build->Configuration Manager.

Solution 2

This happens when the .suo file for the solution becomes locked and Visual Studio is no longer able to write to it. Another symptom of this problem is that you will see temp suo files being created next to the solution when you open it. Try closing Visual Studio and deleting all *.suo files in your working area. Then reopen Visual Studio and rebuild all. No need to manually rebuild your solution. This will fix the issue when it is caused by a locked .suo, as happened to a colleague of mine today.

In his case, the cause seemed to be that he shutdown his laptop while Visual Studio was still open. Maybe the shutdown of Windows didn't complete cleanly? We can only speculate on how the .suo originally became locked.

Solution 3

I tried all the solutions above and that did not fix the issue for me. I found that it was because of the Active configuration in the ConfigurationManager was set to build only the Main (start up) project.

Go to Build > ConfigurationManager

Ensure that all the projects you want to build are checked as in the screenshot below This is a similar issue on Asp.Net forum here and this is the details on MSDN . Although it was weired, bcoz I never changed these settings and it was working properly last week enter image description here

Solution 4

I've encountered a similar problem, the solution (or the probelem) were the Build and Run settings under Tools > Options... > Projects and Solutions > Build and Run where "Only build startup projects and dependencies on Run" was checked. The screenshot shows my currently working solution.

Visual Studio 2012 Options

Solution 5

For me, I resolve the issue by right clicking on the project; Build Dependencies > Project Dependencies. Then manually setting the order for each project. very painful if you have a lot of projects.

enter image description here

Share:
25,545
user1438940
Author by

user1438940

Updated on September 22, 2020

Comments

  • user1438940
    user1438940 over 3 years

    I just upgraded a VS2010 project to VS2012 and am now having a problem where dependent projects are not building on demand. For instance, say I have the following projects in my solution:

    • Library A
    • ConsoleApp 1

    Where ConsoleApp 1 references Library A. If I change the signature of a method in a class in Library A and run ConsoleApp 1, there will be a compiler error due to ConsoleApp 1 not seeing my changes because running ConsoleApp 1 did NOT cause Library A to build.

    If I manually build Library A, then manually build ConsoleApp 1, it works fine. However, I would expect that running ConsoleApp 1 should cause any dependent projects to be rebuilt before launching.

    Could I have something configured incorrectly? Or is this a bug in VS2012?