Jim's Blog Ramblings about novels, comics, programming, and other geek topics

2Oct/077

How to convert a Visual Studio 2005 solution to Visual Studio 2005 Express

Google AdSense

Not everyone is fortunate enough to own a copy of Visual Studio. Although, if you are a student, I highly recommend that you look into the academic license for Visual Studio. With the Academic version, you get everything, but you are not licensed to sell any products produced from it (there's more rules, but that's the major issue besides needing a student id card).

I've needed to convert some solution files to Visual Studio Express because sometimes the computer that I'm working at (such as a computer lab) might not have Visual Studio installed. So I was able to download and install the Express edition, edit the solution files and then open/compile/debug, etc.

For the most part, this information is a complete //HACK, so be warned that you should make a backup of any files that you edit.

I will be using the DotNetKicks.com source code as our demo files.

Step 1 - Make a backup of your files

Step 2 - Create an empty Express solution and project files to use as the template. Save these files anywhere such as a temp directory. These files will be deleted in the end.

Step 3 - Open the VS Express template (step 2) solution file using Notepad. (Notepad2 is a great alternative).

Step 4  - Open the source (Visual Studio Professional) solution file using Notepad (in another instance of Notepad).

Step 5 - Update the source to use the template's header.

The first few lines of the VS Express template solution will say:

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C# Express 2005

The first few lines of of the VS Pro solution will say:

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005

Copy the VS Express lines and paste them over the VS Pro lines.

Step 6 - Finish Solution edits. Save the file and close the instances of Notepad applications.

Your solution has now been converted to Visual Studio Express compatible. However, there are still a few gotchas...

If you are performing this on a solution that contains a Web Project. Then you will need Visual Studio Web Developer 2005 Express (since VS Express C# cannot open web projects) and perform the same action as indicated above. This requires that you break out your Web project from any class library projects. You will need to create a second solution file for your web project and just open the directory where the web files are located at.

In the DotNetKicks solution there are 5 projects that include:

  1. Incremental.Kick.Tests.csproj (Class Library)
  2. Incremental.Kick.Web.UI.Tests.csproj (Class Library)
  3. Incremental.Kick.StoryPublisher.Console.csproj (Console)
  4. Incremental.Kick.csproj (Class Library)
  5. Incremental.Kick.Web.UI.csproj (Web)

Additionally, solution folders are not supported in Visual Studio Express. So if you just converted the DNK solution file, you should see 1 Web Project (Incremental.Kick.Web.UI) and 3 Solution Folders (Solution Items, Tests, Utilities) marked as "(unavailable)". Just right click and choose "remove" for these items.

At this point, you should have 2 solution files. One Web solution and one for the Application/Class Library projects. The class library solution should look like:

DotNetKicks.com Solution in Visual Studio 2005 Express

Additionally, you'll have another Web project in VS Web Developer 2005 Express. You'll just need to update any paths for the project references to make sure the web project can automatically update the .DLL files from the Application/Class Library solution files.

One thing that I did notice was that when I went to build the solution, I had lots of missing library references. I don't understand this part since the path in the reference properties is correct. I fixed this by just copying the files from projectdir/bin/debug to projectdir/bin/release (there's 4 projects). After copying the reference files (x4), I was able to get the "build succeeded" message.

This was a rough and quick walk through of converting a VS solution file. It uses the current code base for DNK which might be different from the DNK download. I'll try to revisit this and clean it up a bit within the week.

 

My Related Posts: , ,

kick it on DotNetKicks.com

James Welch

James Welch is a software engineer in Vermont working for a large information technology company and specializing in .NET. Additionally, he holds a Master’s Degree in Software Engineering and a Bachelor of Science Degree in Computer Science. Jim also enjoys local craft beer, comic books, and science-fiction and fantasy novels, games, and movies.

Twitter Google+ 

Comments (7) Trackbacks (0)
  1. Thanks for the informative article. When I try this conversion technique everything builds fine with no errors and no warnings of any significance, however when I attempt to run the program via the debugger the program never properly starts and exits with the code “The program ‘[3264] Adv.vshost.exe: Managed’ has exited with code -1073741819 (0xc0000005).” Running the executable manually without the debugger also produces the same result, with the program being displayed on the screen for a millisecond and then immediately closing.
    Any suggestions?

  2. Try cleaning your solution – deleting everything from /debug and /release folders, closing/re-opening your solution, etc. then rebuild it. I haven’t seen that error before.

  3. Hi James

    My problem is the other way around…

    I am unable to open Visual C# Express solutions in VS 2005 Pro.

    Is it just me or shouldn’t VS 2005 Pro be able to that?

  4. Hersteinn P,

    I’m pretty sure you should be able to just edit the .sln file with notepad and make it work. I’ve done it before, since I used to switch back and forth between Express and Pro a lot last year. Just compare the headers and copy/paste and you should be able to make the changes, save, and then open the solution.

  5. Hi Jim,

    I tried you approach, I have one class library and 1 web project.

    I have Visual Studion Express (Web developer and C#) The C# opens the class library without any problem.

    But the web project is not opening in Web Developer, when i try to open, it shows the conversion wizard and it dies.

    When i force it open I receive Invalid Project type.

    How do i resolve this?

  6. Are you converting between 2003 and 2005 or just 2005 Pro and 2005 Express?

  7. I used this to convert a SV 2008 to VS 2008 express and it worked great. Thanks for this post.


Leave a Reply

No trackbacks yet.