Visual Studio not saving startup project and solut

2020-02-14 11:02发布

问题:

I've got a C++ solution that always forgets the solution config(debug vs release etc), and startup project when opened.

On startup it always defaults back to debug, and no startup project.

This data used to save correctly, but a few months ago it ceased to function. Originally this was with VS2013, but I'm on VS2015, and the solution continues to not save this data.

I've tried deleting various files.

In the solution folder I deleted the .sdf
In the solution Release folder there was a .suo I deleted

Neither of these fixed the problem.

I don't know where this information is saved, does anyone know how to go about fixing this problem?

Thanks

回答1:

This information is stored in a .suo file. In VS 2015 this file is stored in a hidden .vs directory along the solution file (.vs\solution_name\v14\.suo). You can try to delete this file in case it is corrupted.



回答2:

The selected answer did not work for me, the file got recreated but after that again when running the solution it switched to a wrong startup project. I ended up fetching the complete solution again from our GIT repository, which did fix the issue.