views:

41

answers:

2

Got a bit of a weird problem. I'm checking a solution out of TFS source control, and not making any changes to it; just opening it using the SLN file. If I then close Visual Studio (or do a Save All), Visual Studio prompts me to save the SLN file. Even if I do (by overwriting it, it's a read-only file), it continues to do this every time I open and close the solution, as if I'd added a project or something. Why would Visual Studio do this? What's causing it to think the solution has changed and needs saving?

+1  A: 

I would start by letting it save the solution and then doing a visual diff of the version that it saved vs the one held in source control to see what the problem is. It could just be white space formatting. Also, are you the only person suffering this (if others are using the same solution?)

Paul Hadfield
Nope, the saved version is, byte-for-byte, identical to the source control version. It doesn't seem to be happening on other machines so I guess it's something local to this machine. Can't see what, though.
Jez
The only thing I can see is in Options, for text editor, there is a check box "Auto Detect UTF Encoding without encoding" - is that different for you compared to everyone else? As the solution is a text file and everything (visually) seems the same then maybe it's the code page that's been used - but that feels a long shot.
Paul Hadfield
Yep, it's checked on all our machines.
Jez
+1  A: 

OK, problem solved. As we're using TFS for source control, you're meant to check in the SLN file's corresponding .vssscc file. As we'd checked in the .vspscc for the various projects the SLN file pointed to but not the SLN's .vssscc file, Visual studio didn't consider the solution to be bound. :-)

Fixed it by going to File | Source Control | Change Source Control, then binding the SLN file to the solution's root dir on the TFS server. This created the solution's .vssscc file, which we've checked into source control. Subsequent checkouts now don't cause the problem.

Jez
Very useful to know, any reason why it only affected your machine and was working OK on everyone elses?
Paul Hadfield
No idea. One of the many mysteries of Visual Studio. :-)
Jez