Thursday, March 20, 2008

The Disaster of Microsoft Visual Studio 2008

For any software developers out there who may be considering moving to Microsoft Visual Studio 2008 from Visual Studio 2005, DON'T. Certainly not yet anyway.

On Wednesday I posted this on the MSDN forums:
"Are there any special procedures involved in uninstalling Visual Studio 2008 and reinstalling Visual Stuido 2005?

Will I have to change my project files to get them to work with VS2005 again? I have a VB.NET web application with a dozen+ library DLLs.

Visual Studio 2008 is a total disaster. I have been using it since its official release and it has consistently crashed on me 5+ times a day. It is completely random with no pattern whatsoever. Yes Microsoft, I'm the one with the same IP address who has been sending you those "click here to Send Error Report" logs multiple times per day, every day, for WEEKS AND WEEKS now...

In my 11+ years of professional programming Visual Studio 2008 is most unstable, unreliable tool I have ever used, even worse than Rational Rose 8 years ago (and I didn't even think that was possible).

Back on topic though... Will I need to just rebuild the solution file or will all the project files have to be rebuilt as well? (If it's the later I guess I will try repulling them from SourceSafe and starting from there.)
Ray Dyce responded and confirmed that I'm not the only one having these problems. He said they had abandoned VS2008 as well.

I made the switch from VS2005 to VS2008 on January 7, 2008 and had nothing but problems ever since. The most recent hotfix roll-up which Microsoft released did manage to fix the dreadfully slow compile problem but the debugger was still crashing multiple times per day and completely randomly.

Here are the steps that I went through yesterday to remove our application from the disaster of Visual Studio 2008 and remarry it with Visual Studio 2005. The application is an ASP.NET web application with about 15 DLLs, fairly small. I've worked on projects with 50 to 300 DLL projects, and if you're in that camp, well, it's just going to take you a bit longer than it did me!

First, I'm at a significant advantage because I never removed VS2005 from my machine. We use Analysis Services and I kept VS2005 so that Business Intelligence Developer's Studio (BIDS) would still function. So the problem I was left with was not in uninstalling and reinstalling but just in converting all of our project files back to the VS2005 format.

If you are in this same predicament, it turns out to be fairly simple:

1. I made a ZIP backup of our entire solution as a fail-safe.

2. I checked in the solution into SourceSafe with a label.

3. I checked out a writable copy of everything back out of SourceSafe.

4. I copy/pasted the top-level folder for our solution and named the copy "MySolution VS2008 disaster". This was another fail-safe and a fall back point in case the SourceSafe control files (all those .scc's etc.) got messed-up somewhere along the way (which didn't end up happening).

5. I opened our solution in VS2008 and set the target .NET framework for everything from 3.5 back to 3.0. I right-clicked each and every project and changed this in the Properties dialog.

6. We are using the Telerik Prometheus controls, so I then needed to copy the non-3.5-specific binaries for Telerik back into the bin directory and overwrite the 3.5-specific files.

7. I performed a Clean and Rebuild. In a few cases I needed to go into the references on some projects and remove System.Linq and System.Data.DataSetExtensions as well as the imported namespace System.Xml.Linq. I then closed VS2008 for the last time for a very good, LONG while.

8.
I opened up SourceSafe again and, knowing the date of when we converted to VS2008, for our solution file as well as for each DLL project file I found the history snapshot pre-VS2008 and compared it to the file on my hard disc. Then I applied changes one by one...

Yes, it sounds bad, but it really wasn't. I couldn't just re-pull all the VS2005-era project files because we had added a lot of code since then, and I didn't want to re-add everything. It turns out they all follow the same pattern. Of course, you still have to examine each and every one individually but I found the following changes were all common between them:
  • On the Project tag I deleted the ToolsVersion="3.5" attribute.
  • I set the ProductVersion tag back to "8.0.50727".
  • I deleted the FileUpgradeFlags, OldToolsVersion, and UpgradeBackupLocation tag pairs.
For project files which had been added since we moved to VS2008 I also had to change this line:
<import project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets">

to this line:
<import project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets">

As I visited each DLL I also deleted its bin and obj folders just to made things tidy and prevent any of those strange compiler errors that Microsoft swears will never happen.

9. We are using Microsoft Visual Studio Web Deployment Projects and since it changed between the 2005 and 2008 version I had to modify it as well. The changes were extremely minimal. Mileage may vary since the XML is very customizable and it will depend on how many custom tasks you have defined. I also deleted the Debug and Release folders beneath the project, again, just to be safe.

10. The web.config file was next. There were many AJAX-related lines that I had to put back into the VS2005 version.

11. Then I fired up VS2005 and prayed... It worked.

After a bit more testing I verified that everything was working fine. I am very happy to be rid of Visual Studio 2008 now and will be much more productive without it. Maybe by Service Pack 2 or 3 Microsoft will manage to get the product stable.


Labels: , , , ,