1

I have installed Visual Studio 2012 (aka 11) and uninstalled 2010. However I noticed that solution (.sln) files show an icon that has a little "10" on it while others have "11", with no seeming pattern. They are all solutions that I started out using in 2010 but have since worked on in 11. Why is this?

EDIT: I noticed that I if I open the .sln file in a text editor, the "10" icon corresponds to:

Microsoft Visual Studio Solution File, Format Version 11.00

And the "11" icon corresponds to:

Microsoft Visual Studio Solution File, Format Version 12.00

Yes you read that right (!!!)

EDIT: What if I change the .sln file in the text editor from 11.00 to 12.00? Is that recommended?

JoelFan
  • 37,465
  • 35
  • 132
  • 205
  • 3
    @BrianWarshaw, Tool related questions are *on topic* last time I checked... It must be "programming related" not "code related" – JoelFan Sep 07 '12 at 17:44
  • It's true that tools are in scope to a degree, but I think your question ought to address a problem. So, I withdraw my reference to code (having just checked the FAQ), but I'm not sure the community will find icon inconsistency generally useful. If they don't vote to close, then so be it--I'll still sleep at night. Cheers :-) – Brian Warshaw Sep 07 '12 at 17:47
  • 1
    Well I'm concerned the icon inconsistency may be an indication of a real problem (i.e. some corruption of my solution or Visual Studio installation)... just like with a car noise... the problem is not the noise but what the noise means – JoelFan Sep 07 '12 at 17:48
  • And while it's still open, are the ones with the "11" ones that you've opend with the new version? And are the ones with the "10" the ones that you've not yet opened with the new version? – Brian Warshaw Sep 07 '12 at 17:48
  • As I said in the question "They are all solutions that I started out using in 2010 but have since worked on in 11." – JoelFan Sep 07 '12 at 17:49
  • Sorry, but the way the question was structured, it wasn't clear that the "they" referred to the entire pool, comprising both icons. Likely not the culprit, but have you tried refreshing explorer and seeing if the icon updates? Also, have you run the conversion wizard for each of the solutions that you opened? – Brian Warshaw Sep 07 '12 at 17:52
  • Did not do the conversion wizard... I just thought of opening the .sln files in a text editor... I will update the question – JoelFan Sep 07 '12 at 17:57
  • There's a file format declaration at the beginning of each .sln file, so it may be useful to start with that, yes. – Brian Warshaw Sep 07 '12 at 17:59
  • I am not aware of any project converter tool for 2010 -> 2012 (aka 11). I thought the file format had not changed. I can't find any "converter" in the "Microsoft Visual Studio 2012" folder in the Start Menu – JoelFan Sep 07 '12 at 18:06
  • I'm not on 2012 yet--just figured they would prompt you with a conversion wizard like they do when you open 2005 in 2008+ or 2008 in 2010. – Brian Warshaw Sep 07 '12 at 18:08
  • No, I'm pretty sure they broke with tradition on this one and did not require a conversion – JoelFan Sep 07 '12 at 18:17
  • This is an operating system question. It's related to the way Windows caches file icons for reuse. As such, it's not a programming question. You should use Google search and search on 'Shell Icon Cache Rebuild' or something similar for a solution. Voting to close as off-topic, though; as I said, it's an OS question and not a programming one. (Windows doesn't look inside the .sln files to see if they're marked with version 10 or 11; it just knows that the last time Explorer looked in that folder, they had the 2010 icons, and keeps displaying them.) – Ken White Sep 07 '12 at 18:52

2 Answers2

3

From what I've been able to figure out:

If you make any change inside Visual Studio that causes it to change the .sln file (i.e. adding a text file at the solution level, then deleting it, then doing "Save All"), the header of the .sln file will change to:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012

and the icon will change to "11".

You can manually change the header if you want and the same thing will happen.

However, the icon and header really don't matter... you can leave it as is and everything will work fine because the file format is the same as VS2010.

I'm not sure what will happen if you change the headers to 12.00 as above and then try to open it in VS2010

JoelFan
  • 37,465
  • 35
  • 132
  • 205
1

Ignore the file format version number. It would have kept in sync with the VS version number, if it wasn't for VS2003, version 7.1. Essentially a major maintenance release for VS2002, the version that first introduced .NET support. So it's off-by-one right now.

The file format versions have increased with every VS release. That caused a lot of pain, when you worked in a team you'd have a pretty big headache if not all of the team members moved to the next version at the same time. Lots of questions about it at SO.

That changed in VS2012, it is the first version of VS that can read and write the solution and project files of the previous version. Which explains what you see, your VS2010 projects just never got converted, even after opening it in VS2012. Nice feature.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536