'Visual Studio 2015 builds all projects every time even though only one project has changed

I have a visual studio 2015 solution with a bunch of C# projects in it. When I build, visual studio will build every project every time. I get a lot of these errors in the output window when opening my solution:

[Failure] Could not find a part of the path 'C:\Users\myusername\Temp\8.NETFramework,Version=v4.5.2.AssemblyAttributes.cs'.

I tracked the problem down to the fact that we have just moved to a virtual environment and that directory is getting cleared each time I log out. If I delete the .vs folder in my solution first and then start visual studio it works fine (because it will regenerate those files), but I would rather not do that every time.

Is there a way to tell Visual Studio 2015 to put those files somewhere else?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source