Recently, I started running into an issue with Visual Studio, solution files (.sln), and project files (.csproj). For the various clients that I support, I have four versions of Visual Studio installed… This means that if I try opening a solution file in the wrong one, it will either say it’s incompatible with that version or it will want me to upgrade the solution to the newer version I had opened. This makes opening a solution like walking into a minefield because some solutions are just not compatible with newer versions of Visual Studio.
but wait, Microsoft provides the Visual Studio Version Selector. This awesome tool will read the solution file and then open it in the appropriate version. However, I now have a new problem, all my solution files and project files are somehow associated with the oldest version of Visual Studio… and I can’t tell Windows to use the Version Selector as the default program.
Notice that the “Always use the selected program to open this kind of file” checkbox is disabled? So I can’t tell Windows to use it for this file type.
However, I found a registry work around for this…
- Open Regedit, I suggest doing windows key + r and then typing in “regedit”
- Navigate to the following subkey “HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerFileExts”
- Find the file extension you are having problems with. In my example, I use .csproj
- Expand to view its sub-keys
- Delete the sub-key “UserChoice”
This removes a preset program associated with the file type that would not allow the user to change the default program. Now that we have removed that, we can see that the checkbox is now enabled and we are able to set the default application for the file type.
Let me know if this is an issue plaguing people out there. It’s tempting to run through all file types and remove all the UserChoice sub-keys… though that would warrent writing a little program to do it.