Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving a project 1

Status
Not open for further replies.

realm174

Programmer
Jan 3, 2002
154
0
0
CA
- Using VB 2008 Express
- Vista (not sure that really matters)

I have a few different projects that have been saved in the same location as one another. As a result, I have a mess and loads of files.

Is there an "easy" way to move projects to their own folders, in such a way that related files will move along?

Thank you!!

Cheers,

Realm174
 
Not sure if this is easy, but if the projects are included in a solution file, do the following:

1. In solution explorer, right click the project name and select Remove
2. Open a file explorer window and move the project file and its associated files to a new folder
3. In solution explorer, right click the solution and select Add, Existing Project
4. Navigate to new project location
5. Select project file and reselect to add project back in to the solution projects

Good Luck!
 
Thanks for your response!! But I would still have to go and figure out which file belongs to which project. I was hoping there might be a different way to do that. I was thinking something along the lines of "Save project as" and it would save all the related files to the new location. But I couldn't find something like that.

I guess my next step will be to look and see if there's any file in text format that contains the information, and then write a quick app to do what i'm trying to do manually...

I know I've come across somewhere a list of types, that form part of a project. Does anyone happen to have a quick link to such a list that they can share?

thanks!


Cheers,

Realm174
 

Create a new project in a new location (in a separate folder), add a couple of Forms, name them, add a class, a module, a reference, etc. and save it all.

Look in Windows Explorer where all of these files end up.

That will give you some idea of what needs to be moved and where.

Just an idea....

Have fun.

---- Andy
 
oh Thanks Andy!! That's a good idea, I never thought of that.. Of course, why would I look for a simple way when there are complicated ways around!! :) That will at least get me started on sorting those out.

Cheers,

Realm174
 

And I wouldn't *move* files, I would *copy* them to a new location. After you move all the files that you think should go there, just start the project and hopefully you will not get the error message "reference is missing" of "Form is missing".

As you propbably know by now, it is a good idea to start a new project in its new, separate folder every time. My "VB Junk" folder (VB 6) and my "NET" folder are full of folders with projects. Easy to find them, easy to copy, easy to give it to somebody.

And don't forget to open sln file or vb.proj file in Notepad and look for any paths that may be there. Those paths may be pointing to the original location of files, and when you move files, you may want to point them to a new location.

Have fun.

---- Andy
 
Thanks Andy, that's exactly what I did last night, and managed to cleanup the whole thing. I actually moved the files, fixed the sln, opened my projects one after another, and they're all working. Case closed! :)

Lesson learned, I won't be so eager to click on OK when I first save a project and have all the files going into the same spot! :)

Cheers,

Realm174
 

You know, for the benefits of other users with the same problem - if you have documentation of what to do, what to look for, how to fix it, what to change, etc - you may want to share it here.

I am glad you solved it :)

Have fun.

---- Andy
 
Hi Andy (and everyone else),

Here are the steps I followed to fix that problem:

- Locate the .sln file pertaining to the project you need to move. In my case, the file is client.sln

- Open the file with notepad or any other text editor, and look for the "Project" line, which has the name and relative path of the vbproj file. In my case, it said Client\Client.vbproj. That's all I needed from the sln file, so closed it. If you wanted to move your project to a different location, this is where you would change the path for it. For example, you could change the path to "Client-Server\Client.vbproj" then you need to make sure you move the vbproj file to that location.

- Open the vbproj file identified in the previous step with your fav text editor. As this is in all reality an xml document with a different file extension, I open mine with XML-Notepad which allows me to see things in a treeview format.

Go through the different options in that file and check for any path that needs to be adjusted. You primarily need to look for the items located under:

Project\ItemGroup\Compile

but it's not a bad idea to look at everything that is under any of the ItemGroup (there are a few)

Make note of the different files as you go through, move them to the destination folder of your choice, and adjust the path withi the vbproj file as you go.



I hope this helps. I'm considering putting together a "move project" app whenever I find a few free minutes, just so that if I ever need to do that again, I don't need to do it manually... :)



Cheers,

Realm174
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top