Visual Studio 2017 - Build Failure. Error: 'path' cannot be an empty string ("") or start with the null character.
After upgrading to Visual Studio 2017 version 15.2, building some of my projects started to fail with the following error message:
Build Failure. Error: 'path' cannot be an empty string ("") or start with the null character.
The problem only appeared for projects where I enabled the lightweight solution loading feature.
Lightweight solution loading:
Many common tasks, such as navigating through your codebase, editing code, and building your projects will not require any projects to be loaded at all. Therefore Microsoft created the lightweight Solution load feature. The effect is that Visual Studio will not fully load projects until you start working with them increasing performance especially for large projects.
As the problem only happened for these projects, I decided to disable Lightweight solution load again. This indeed solved the problem for me(note: I had to close and reopen the solution before I saw an effect).
Hopefully a bug fix will be released with the next update…