Thursday, August 17, 2006

VS2003, Perforce, and Web Projects

At work we are converting our source control from pvcs to Perforce. The transition has not been smooth. I tested Perforce before our purchase and a web project worked fine. But web projects are very sensitive. Perforce even states they don't support web projects integration with Visual Studio.
We kept getting errors like

One or more of the project's destination paths are invalid. To open this solution, you must specify valid paths for each project. The error returned was "The Web at already contains a project. You need to choose another location for your Web project.

and

Visual Studio 2003 already contains a project. You need to choose another location for your Web project.

The best we can tell the steps to integrating a web project in Visual Studio 2003 and Perforce are as follows:

Check all the web project code directly into Perforce not using Visual Studio.
Create a virtual directory in IIS manually. Under the tab "Virtual Directory" remove the application.
In Visual Studio create a blank solution. Select "File/Source Control/Open From Source Control".
The perforce dialog box appears. Select the right attributes on the first panel and select "OK". On the second dialog box select your csproj file. If the moon is in the right phase and fortune smiles on you, the next dialog will have your web site url correct. If the proposed web site has "_1" appended, abandon all hope; somethings wrong. If the proposed web site url is correct, contine and life looks good.

We get an oddity where sometimes when adding the second web project Visual Studio will create an entire new .sln file for us and not add the second project into the current solution.

Well, all that being said, we are moving soon to VS2005 and all these problems will be solved. Right?

1 comment:

Anonymous said...

Thanks a lot! This post really helped me out!