Upgrading old Visual Studio Solutions

I recently had to upgrade some old Visual Studio 2003 (!) solutions and projects to Visual Studio 2010. I tried to do that just by opening the solution and let the conversion wizard to its job. I had some challenges with the web application projects, including the old style web services.

The first lesson was to delete the project.csproj.webinfo file, because it contains an invalid reference to the project file, e.g.

<VisualStudioUNCWeb>
    <Web URLPath = “http://localhost/ExportWS/ExportWS.csproj” />
</VisualStudioUNCWeb>

Since the web site hadn’t been created, this URL was invalid.

Then, after the conversion, in one solution, I got the following error when re-opening the solution:

The following Web projects must be converted to the new Web Site format. The conversion process will remove all source control binding and the project will not be under source control after migration.

And then:

One or more projects in the solution were not loaded correctly. Please see the Output Window for details.

The output window contained the following error:

Some of the properties associated with the solution could not be read.

It turned out that the solution file had been corrupted. There were two extra GlobalSections. First there were:

GlobalSection(TeamFoundationVersionControl) = preSolution
    SccNumberOfProjects = 12
    …
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
    Debug|Any CPU = Debug|Any CPU
    Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
    …
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
    HideSolutionNode = FALSE
EndGlobalSection

But then, were were two extra GlobalSections:

GlobalSection(TeamFoundationVersionControl) = preSolution
    SccNumberOfProjects = 12
   …
EndGlobalSection
GlobalSection(TeamFoundationVersionControl) = preSolution
    …
EndGlobalSection

After removing these using Notepad, the above errors went away.

In another solution, each time I opened it I got a dialog saying the web projects must be converted to the new format. I found the solution here: http://connect.microsoft.com/VisualStudio/feedback/details/334842/repeated-conversion-of-project-file

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s