Results 1 to 7 of 7

Thread: [RESOLVED] HELP please!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2013
    Posts
    123

    Resolved [RESOLVED] HELP please!

    I was going to add a tricky bit of code to my project and since VB always saves when you don't want it too, I decided to make a "copy" of my entire project folder and saved it on my desktop. Well guess what? Once I did that, VS changed my association to that file, but I realized something was wrong so I deleted the copy, put it in recycle, and shredded it and now it's gone. But when I load up my project in VS, it's missing the design view on page one and two and the code from page one. Gone. I tried Add/Existing Item on my folder, and it brought back my code, but not the design views. When I click on my project.design, a bunch of code comes up but not the form I designed. I have no idea how to fix this and am both scared I'll loose my project, and about to rage at the same time. Why the f- can't I make a copy of my project?!? Anyways, does anyone know how I can fix this?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: HELP please!

    You can make a copy of your project. You simply open Windows Explorer and copy the solution folder. It's that simple.

    As for VB saving "when you don't want it too" (sic), VS has to save before building and it has to build before executing. If you want to be able to make changes and then roll back to an earlier version then use source control, of which there are various free options.

    By the way, please provide useful thread titles in future. The title of this thread is as useful as no title at all. The title should describe the topic.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2013
    Posts
    123

    Re: HELP please!

    I'm sorry, I was feeling desperate. I will keep that in mind from now on when making thread titles.

    1. I copied my project folder, like you said, and saved it to my desktop
    2. I opened VS and clicked on this project to edit it
    3. VS gave an error saying something to the effect of incorrect associations
    4. I closed VS becuase this project (the copy) did not load correcty
    --I restarted VS and loaded up my original project from it's original folder and it seemed to work fine
    5. I deleted the "copy" from the desktop because it seems making a copy does not in fact work...
    6. I opened VS and tried loading up my original program directly from VS 2010/Projects
    7. It loads up, but form1 and form1.design are gone from my program
    8. I click on Solution Explorer, and it says form1 is located in the COPY folder............
    8. I clicked to "remove" on this erroneous entry from Solution Explorer
    9. I right-click Solution Explorer and Add/Existing Item and select my form1 from it's original folder... where it's always been...
    10. Design view for form1 is gone...

    Sorry I was not clear enough. And no, making copies of your folder and trying to run it from VS messes up the associations for some reason. At least, this is what happened to me.

    So:

    1. Any ideas how I can get design view back for form-1?
    2. Any ideas how I can make a copy of my project without VS going haywire if I actually try and open the copy?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2013
    Posts
    123

    Re: HELP please!

    Okay, I had to make another copy and paste it on my desktop, then change the name of this folder to "Project Name - Copy". Now the design view came back, but this is pretty ridiculous because Form2 loads as the original page and Form1 does not load at all because Form2 is not suppose to call it, so my program is completely broken atm.

    So:

    1. How do I make the program load up form1 first, then
    2. How do I reassign Form1 Design view (non desktop-copy) back to VS 2010/Projects instead of off my desktop?

    I appreciate any replies.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: HELP please!

    Why does the desktop have to be involved at all? Simply open Windows Explorer, open your VS Projects folder and then Ctrl+drag the solution folder for the desired project into some empty space. That will duplicate the folder and append " - Copy" to the name. Easy as it gets. At any point, you can simply delete the original solution folder and rename the copy by removing the " - Copy" and you're back to how you started.

    You'll notice that I keep saying "solution folder". The solution is the top level and the project is under that. One solution can contain multiple projects and often does. It's that top level that you need to copy and don't pointlessly copy it anywhere other than the Projects folder that it's already under.

    To set the startup form for a project, you open the project properties and set the Startup Form field. As for the rest, I'm not going to comment because it's hard to know what exactly the issue is. You might want to open the SLN and VBPROJ files in Notepad and check their contents. If you see any obviously wrong paths in their then you can correct them who knows what the actual damage is. Just be careful editing those files by hand though, because you may do more harm than good if you make a mistake.

    You might be better off just creating a new project and then trying the Add Exiting Item option to add the items from your old project to the new. That might right any wrongs that have occurred at the file level.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Feb 2013
    Posts
    123

    Re: HELP please!

    Solution to #1 in post #3-4, and solution to #2 in post #4: Load up your project, right-click your project, select Add then Existing Item. Find your project.vb and select it. Double click it to load the form back onto your original form. In Solution Explorer, "remove" the COPY version. In Solution Explorer, right-click your project and select Properties/Application/Startup From (form1). It's that easy..... only took me 2-hours to figure it out...

    Solution to #2 in post #3: You can make copies, just don't ever load up your project from that copy! It is a copy only, in case your original goes bad. At least, this is how I view it since what happened to me.

    I hope others who attempt the same thing I do find this thread useful.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2013
    Posts
    123

    Re: HELP please!

    Quote Originally Posted by jmcilhinney View Post
    Why does the desktop have to be involved at all? Simply open Windows Explorer, open your VS Projects folder and then Ctrl+drag the solution folder for the desired project into some empty space. That will duplicate the folder and append " - Copy" to the name. Easy as it gets. At any point, you can simply delete the original solution folder and rename the copy by removing the " - Copy" and you're back to how you started.

    You'll notice that I keep saying "solution folder". The solution is the top level and the project is under that. One solution can contain multiple projects and often does. It's that top level that you need to copy and don't pointlessly copy it anywhere other than the Projects folder that it's already under.

    To set the startup form for a project, you open the project properties and set the Startup Form field. As for the rest, I'm not going to comment because it's hard to know what exactly the issue is. You might want to open the SLN and VBPROJ files in Notepad and check their contents. If you see any obviously wrong paths in their then you can correct them who knows what the actual damage is. Just be careful editing those files by hand though, because you may do more harm than good if you make a mistake.

    You might be better off just creating a new project and then trying the Add Exiting Item option to add the items from your old project to the new. That might right any wrongs that have occurred at the file level.
    Thank you for the suggestions jmcilhinney. I will add to your rep for your ideas, however I did find the answer I was looking for and posted it on this thread for other's to view if they have similar problems. This thread is RESOLVED!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width