Solution Icon

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
520
Programming Experience
3-5
I started a project in vs2010 and it has a v10 sln icon, and i switched to vs2012. Can you change the sln icon to the v11 one? since they are both .sln why are they different?
 
The SLN and VBPROJ files used by VS are actually just text files and, amongst other things, they contain information about the version of VS that created them. I think it was with VS 2008 that the Version Selector tool was first distributed. It's actually that that is what opens VS solutions and projects and it reads the file to determine what version created it and tries to open it with that version. That's also what determines the icons displayed.

In previous versions of VS, when you opened a solution or project created in an earlier version, VS would uprade it to the current version, which meant changing that information in the SLN and VBPROJ files. Generally there were no changes other than that version information but it still meant that the solution or project could not be opened in the earlier version any more. This was a problem for multiple developers working on the same project with different VS versions.

I haven't tested the feature yet but I believe that VS 2012 bucks that trend by not upgrading solutions and projects created in VS 2010. That means that those solutions and projects can still be opened VS 2010 if desired. There may be a way to force VS 2012 to perform the upgrade but I don't have it installed on my work machine to check. If this thread is still open when I get home I may have a look then.

That said, I can't really see the point. You don't actually gain anything by doing so. Yes, the icon will change but is that really a gain? Also, you'll lose the ability to open the solution in VS 2010. Maybe you don't intend to do that anyway but we can't always foresee everything.

If you're really determined to do it but VS 2012 can't be forced to perform the upgrade then you can always do it manually. Create a new solution in VS 2012 and then open the two SLN files in Notepad. You'll be able to find the part in each that specifies the version so you can update the old one by copying and pasting. You'd do the same for the VBPROJ file. I can't guarantee that there aren't some other changes between the two as well though, so you'd want to investigate fairly thoroughly before doing that. Even then, there is a certain amount of risk so make sure you create a backup.
 
Thanks that did it. I had it running when i changed it and it sensed its modified outside vs and ask if i want to reload. Everything seems fine. not everything you do has to have a gain. I guess i am a little ocd.
 
Last edited:
Back
Top