Tuesday, February 20, 2007

Adding VS 2005 solution file to the New menu

If you're going to start something you should start it right, and that especially applies to a software development project. Depending on the length of your project you may have to live with things for years. One of the things I've really started to get attached to is the concept of working IDE free (where it makes sense). Which isn't to say that I'm going to be coding in Notepad++ any time soon, but it does mean I'm going to setup my project outside of the IDE. Now if you haven't read Mike Robert's article entitled How To Setup a .Net Development Tree I definitely recommend starting there. But if you have read it one of the first things you are going to need to do after creating your folders is create the Visual Studio solution file. Now Mike recommends creating it using the IDE and moving it but personally I think it'd be much nicer if we could just create it from the filesystem. Well it turns out you can and it's not actually that difficult as I found out from Jean-Paul Boodhoo during his amazing week long developer course.

So our end goal is to add the ability to create a new Visual Studio Solution file under the New right click option in Explorer. The first step is to create an actual bare bones Visual Studio Solution File. So to start create a file called Visual Studio Solutions.sln on your file system. Assuming you are using Visual Studio 2005 you will want this file to have the following content:

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
   GlobalSection(SolutionProperties) = preSolution
      HideSolutionNode = FALSE

The next step is to create a registry file to import this new type. I called mine vss.reg but you can name it whatever you want as long as it ends with the reg extension. The contents of this file (assuming Windows XP) are:

Windows Registry Editor Version 5.00

"FileName"="Visual Studio Solution.sln"

The next step is to copy the skeleton solution file you created into the C:\Windows\ShellNew directory (note that you may have to create the ShellNew directory manually). After that is complete all you should have to do now is run the reg file you created. You should now be able to right click in Explorer and see Visual Studio Solution under your right click -> New menu (note that I've seen it where someone had to bring up the menu two times the first time to get it to show)

No comments: