Goodbye to Visual Studio web projects and SourceSafe

A bullet

Bite the bullet. Get rid of both SourceSafe and web projects, in one fell swoop.

I am not the only one who dislikes Visual Studio .Net web projects and SourceSafe. I am using the term “dislike” loosely here, as one “dislikes” cranial hemorrhaging and Richard Clayderman. They are worth getting rid of, but it can be hard to bite the bullet and get it done, and the hand editing can be tedious work if you have a lot of web projects.

So I wrote a couple of utilities to make it a little easier. One, EnableWebItemsInNonWebProjects.exe, is for tweaking your Visual Studio .Net 2003 installation to support web items in non-web projects. It is an automated implementation of this method.

The other utility, MakeLifeBetter.exe (sorry for the whimsical name; these are quick hacks and my productization department is on leave), is for simultaneously converting web projects to “local” (non-web) projects and stripping away SourceSafe bindings if they are present. I find that it is advisable to make these two changes together, for two reasons:

  • If you convert web projects to non-web projects while still hosting them in SourceSafe, others will experience weirdness when they “get latest” and receive your changes. [One of my biggest pet peeves with the combination of the Visual Studio .Net 2003 project system and SourceSafe is that problems never seem to be perceived clearly, they always seem to be "weirdness" or "voodoo" (of the mythical nasty variety) until you start delving under the covers. I don't like the covers, I guess.]
  • If you migrate to Subversion while still using web projects, Visual Studio will have problems, because web projects are not happy about subfolders with names like .svn. Your mileage with other version control systems may vary.

So assuming you want to migrate to a proper version control system and abolish the use of web projects in your work, then this utility may be for you.

If you want to make only one of these two changes to your solution, then you’ll have to make the appropriate (fairly obvious) modifications to the source code, which is provided in the download. It is undesigned and uncommented and unglamorous; I know. Don’t bug me about it.

A smiley face

Now that I’m no longer subjected to SourceSafe and web projects at work, I look roughly like this. With more hair.

I recommend:

  1. migrating your tree as-is to a fresh Subversion repository using vss2svn (I suggest the bugfix branch, login as guest:guest),
  2. checking out a working copy from your new repository (e.g. using TortoiseSVN),
  3. running this utility on it,
  4. trying it out in Visual Studio, and
  5. committing the changes.

I also strongly recommend just working with TortoiseSVN and not bothering with the source control functionality in Visual Studio. It may just be a matter of preference, but give it a try, at least.

Both of these utilities are command-line tools. Both print terse usage instructions when invoked without arguments.

Caveat: these are quick’n'dirty hacks. Error checking may be charitably described as “scant.” They have been tested on one (1) VS.Net installation and one (1) solution, containing twentyish web projects. They worked in these test cases. In your case, they may very well steamroll your project into the ground, bankrupt your company, poison your relationships with your loved ones, and give you cooties. Use at your own risk. Read the source code. Make sure you do not stand to lose any work if it all goes awry. Back up your VS.Net installation. Work on a pristine working copy from a reliable version control system. Diff to check that it did the right thing. Do not — do not — sue me. Always sue only those who have money, that’s where the return on investment is, and you get to feel like Robin Hood. Watch your cholesterol. Cut down on caffeine, TV, hallucinogenic drugs, and procrastinatory blog surfing. Read Chekhov. Work out. In your darkest moments, in your deepest despair and loneliness, remember that in that state your forward vision is impaired: there are better times ahead, though you cannot see them. This too shall pass.

Here is the download: IDetestWebProjectsAndSourceSafe.zip. Sorry for that name too.

One Response to “Goodbye to Visual Studio web projects and SourceSafe”

  1. Wiebe Tijsma Says:

    Thanks for this! (and for your humorous writing style – makes techy info a lot easier to read :))