Question

I'm trying to create a new ASP.NET website and add it to my subversion repository but it does not work because subversion only add the C:\Users\XXX\Documents\Visual Studio 2008\Projects\WebApplication1 folder and ignores the project files located in C:\Users\XXX\Documents\Visual Studio 2008\WebSites folder.

Why can't I add a ASP.NET website to Subversion like WindowsFormsApplications?

How shall I add a ASP.NET website to Subversion repository?

Was it helpful?

Solution

I have a suggestion for a solution that fixes the problem, but I do not know how good the solution really is... can someone evaluate this?


1) Create two folders in repository(svn://localhost/repo/):

Projects

WebSites

2) File -> New -> Web Site (WebSite1)

3) Right click the Solution 'WebSite1' in the solution explorer and choose "Add solution to Subversion" and choose Project Name WebSite1 and Repository Url svn://localhost/repo/Projects/ with the Local Folder C:\Users\UserName\Documents\Visual Studio 2008\Projects\WebSite1 and click "Add trunk Folder for Project", the project will now be created in svn://localhost/repo/Projects/WebSite1/

4) Right click the Solution in the solution explorer and choose commit

5) Right click the c:\...\WebSite1\ in the solution explorer and choose Project Name WebSite1 and "Add Selected Projects to Subversion" and choose Repository Url svn://localhost/repo/WebSites/ with the Local Folder C:\Users\UserName\Documents\Visual Studio 2008\WebSites\WebSite1 and click "Add trunk Folder for Project", the project will now be created in svn://localhost/repo/WebSites/WebSite1/trunk/ at last choose "Mark as Managed by Subversion"

6) Right click the Project in the solution explorer and choose commit

By doing this way the files in the Projects and WebSites folder gets loaded in to the Subversion repository and you have ability to create branches, tags and trunks.

I use SlikSVN(Subversion) and AnkhSVN(Visual Studio Subversion Interface) when i do this.

OTHER TIPS

The folders have to have a common ancestor...that's an SVN thing. I tend to use the following structure:

C:\Projects\Clients C:\Projects\Clients\ClientName C:\Projects\Clients\ClientName\Web C:\Projects\Clients\ClientName\Libraries C:\Projects\Clients\ClientName\DB C:\Projects\Clients\ClientName\Design

ClientName is the repository root. If you decide to implement this structure, you can Export your already controlled code to the correct directory, and then Relocate your repository to the new place. I've had to do this a few times.

Good luck!

This is the article which helped me a lot when i was stuck long ago. Example uses an asp.Net project:

Found help on Visual SVN website. You could solve the problem by rearrange the website project as a blank solution and copy all the web files under the same project directory.

The solution could then be added to subversion - same for Ankh and visual SVN client.

Or if you wanna start a whole new project: 1) File -> New -> Project -> Empty Project 2) Remove the empty project 3) Add a webb application project by rightclicking soulution: Add -> New Project -> ASP.NET Web Application

What do you think, this would solve the issue right?

Actually, you can just add the folder to your subversion repository, and then just use "Open Web Site" and open that folder from your working copy. It's probably not ideal, but that's what we've done while we figure out all this subversion stuff ourself.

The Blank Solution is probably better, then you can put the solution file in the repo. I think all developers using the repo will have to have the same exact working copy path (i.e. C:\WorkingCopy) in order for that to work though. Having tested this today, this is not correct. It doesn't matter where the path of your working copy is. It seems to work fine as long as the Web Site folder is in the same directory as the .sln file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top