Copying a project

  • Thread starter Thread starter Paul Cotter
  • Start date Start date
P

Paul Cotter

First - is this the right venue for Visual C# questions?

How do you duplicate a project. So if I have a directory

c:\c#\projects\proj_1

Containing proj_1.sln, proj_1.suo and a subdirectory
c:\c#\projects\proj_1\proj_1 that contains the source etc.

How do I recreate this as proj_2 including the directory
c:\c#\projects\proj_2\proj1_2

The complexity of the names I am using will probably lead you to the
(correct) idea I am fairly new at this...
 
I noticed that when I inspected the inside of the proj_1.sln (a char 256
file) and the proj_1.suo (a Unicode file) they both contained absolute
addresses to c:\c#\projects\proj_1\proj_1. (as opposed to relative
addresses of the form ..\proj_1)

I was afraid that if I just copied the directories then the references would
just point back at the original files and some form of corruption may take
place. I suspect I can just manually edit these files, but wanted some
confirmation.

Thanks for the tip on not using c# as a directory name. I do not see the
problem, but believe it could easily exist.
 
Yes, this is the right place..

And you should probably just use Windows Explorer to organize the
directories how you want.. is that what you mean?
 
Just use Explorer to copy proj_1 with all its subfolders to proj_2. I don't
believe that you can rename subfolders as well, however. The project and
resource files tend to hold sufficiently qualified paths to different parts
of the project so that you end up having difficulties.

I seem to recall that some people have eventually encountered a bug of some
kind if the path contains the "#" character, so you might want to have a cs
folder rather than c#.

--Bob
 
I would get rid of the .suo file before using a copy. You can start Visual
Studio without it; you just may have to reset the startup project if there
is more than one project.

The .sln file should have relative paths.

-Rachel
 
Back
Top