Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS corrupted .sln file?

When I try to open my .sln file, Visual Studio quits on me. I can open it by opening up TFS, getting a specific version, choosing the latest version, forcing an overrwrite, opening up the .sln file, and then ignoring an 'incompatible doc message".

However, I would like to know what's wrong and how it can be fixed, in case some day I can't do this.

How can this be fixed?

like image 376
Larry Watanabe Avatar asked Jul 21 '10 13:07

Larry Watanabe


People also ask

How do I open a .sln file in Visual Studio 2022?

Visual Studio 2022 : Double Clicking on solution file in the Source Control Explorer opens the sln file as plain text - Visual Studio Feedback.

How do I read .sln files?

A file with . SLN extension represents a Visual Studio solution file that keeps information about the organization of projects in a solution file. The contents of such a solution file are written in plain text inside the file and can be observed/edited by opening the file in any text editor.

Where is the .sln file?

sln" file is created in the parent folder, along with the hidden ". vs" folder.


2 Answers

I would think this is more likely to be the .suo (which is a hidden file). These are know to corrupt (and this has been true since at least VC++ V6). Deleting it will clear all sorts of odd/erroneous behaviour in VS.

(The .suo holds local settings: which files are open and layout, breakpoints, bookmarks, ... only: nothing that really matters to the solution or projects.)

For Visual Studio 2015 and 2017: rather than being in the same location as the solution (.sln) file, it is now held in a, hidden, folder called .vs in the folder containing the solution file.

like image 91
Richard Avatar answered Dec 07 '22 08:12

Richard


Have you tried creating a new sln and importing all the projs? if it doesn't solve the corruption, it may point to a project with a problem.

like image 20
SteveCav Avatar answered Dec 07 '22 09:12

SteveCav