הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Question
Tuesday, April 14, 2015 5:13 PM
I had to complete a project for tomorrow, and realised the names of everything was "WindowsApplication4". For aesthetic purposes I changed the names of the folders, .sln, .exe and .vbproj to "quadcopter project" and "quadcopter booking system"
After double clicking the newly named "QuadcopterBookingSystem.sln" it refused to load the project, giving an error in the output similar to
"E:\Quadcopter booking system\WindowsApplication4\Quadcopter project.vbproj : error : The project file could not be loaded. Could not find file 'E:\Quadcopter booking system\WindowsApplication4\Quadcopter project.vbproj'. E:\Quadcopter booking system\WindowsApplication4\Quadcopter project.vbproj"
changing all the names back to "WindowsApplication4" did not help and now I am stuck with an almost completed project I have a few hours to complete and the same error
All replies (31)
Tuesday, April 14, 2015 8:05 PM ✅Answered
Frank
I have the code and the forms, no other errors except for looking for form1. would creating form1, running the project then deleting it work?
Ok, good.
In Solution Explorer, the second item from the top is "My Project". Double-click that and it'll open showing some tabs. The top-most tab will show this (or similar, I have an older version):
As you can see there, it needs instructions on which form to use when the program starts so click that and select whatever form should be the correct one, then try it please.
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 8:19 PM ✅Answered
to everyone- started it and it worked, added the notepad files I wanted to open to the file, moved it to the correct place and I'm pretty sure it's 100% working :D with the extra bonus of having a decent name like I had originally intended
I don't know how this will get closed though as I forgot my first account's password
edit: extra thanks to Frank you've been really helpful :)
Tuesday, April 14, 2015 5:34 PM
Matthew,
I suspect that it's because you haven't changed the default namespace.
If you open Visual Studio and browse to the new folder, will it let you open it?
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 6:07 PM
If you mean open from visual studio instead of my usb, it gives the same error. I had changed the names back to what I think they all were.
would it be possible to restore the project to the last working version?
Tuesday, April 14, 2015 6:12 PM
If you mean open from visual studio instead of my usb, it gives the same error. I had changed the names back to what I think they all were.
would it be possible to restore the project to the last working version?
Not unless you did a backup first, or at least not that I can think of.
Did you try to open both the project (.vbproj) and the solution (.sln)?
The project isn't gone, so you might want to copy your folder to a safe place before you do anything else, but obviously it doesn't like to be modified outside of Visual Studio so it's giving you grief right now.
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 6:13 PM
What are you distributing? Is the .exe is all others would get? If so, you dont need to change the project name. You just change the .exe name that Visual Studio makes for you. You set that name the properties. Probably the assembly name only?
If you dont have a backup from before the change you could change the names back get it working again, then try again.
You probably had other files that need a name change that you did not change etc. It is hard to do, if you even can. I never do. Its easier to create a new probject with the name I want.
Tuesday, April 14, 2015 6:16 PM
That's a tough one. Here are some instructions I give to my programming students. However, we only use a single form, so I'm not sure how well it would work with multiple forms. C# includes an option to refactor, which works better than anything in VB. Maybe that will be added to VB in the future.
Note, that my instructions begin with the advice to make a duplicate before making any changes.
===================================================================
Changing a Project Name:
Once the program has been saved, the project name cannot easily be changed as there is no "Save As." Exit Visual Studio and rename the main project folder to a new name at the desktop, or make a duplicate copy and rename it. Then open the renamed project in Visual Studio. All the old names will still be there.
Start in the Design screen. In the Solution Explorer window, click on the solution name. Click on File in the menu. Scroll down to Save projectname.sln As. Type in the new name. In the Solution Explorer window, right-click the name just below the solution name. Click the Rename option in the window that opens, and retype the new name.
Select Project from the menu bar or right-click the projectname in the Solution Explorer window.
Scroll down to projectnameProperties. A window will open. Change the Assembly name and Root namespace to the new name. Then click Assembly Information. Another window will open. Change the Title and Product names, and click OK
Click the X at the top left to close. Save and exit. On the desktop, remove the old .sln and .suo files from the project folder.
However, some of the internal files and folders will still retain the original names and should not be changed.
Solitaire
Tuesday, April 14, 2015 6:20 PM
as far as I know the only thing I need to show is the .exe
could you find anything in any of my screenshots that has an inconsistent name? I can't think what else I may have changed. I don't suppose the folder name is important
Tuesday, April 14, 2015 6:23 PM
as far as I know the only thing I need to show is the .exe
could you find anything in any of my screenshots that has an inconsistent name? I can't think what else I may have changed. I don't suppose the folder name is important
I don't know who you're talking to - please be explicit.
Your code is still safe; a .vb file is just a text file, nothing more, so that code is all intact. As for 'what's important', it all is.
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 6:25 PM
If you mean open from visual studio instead of my usb, it gives the same error. I had changed the names back to what I think they all were.
would it be possible to restore the project to the last working version?
Not unless you did a backup first, or at least not that I can think of.
Did you try to open both the project (.vbproj) and the solution (.sln)?
The project isn't gone, so you might want to copy your folder to a safe place before you do anything else, but obviously it doesn't like to be modified outside of Visual Studio so it's giving you grief right now.
Still lost in code, just at a little higher level.
:-)
.vbproj is working correctly, so is the .exe so that's good i guess. It looks like just the .sln is having problems
Tuesday, April 14, 2015 6:27 PM
as far as I know the only thing I need to show is the .exe
could you find anything in any of my screenshots that has an inconsistent name? I can't think what else I may have changed. I don't suppose the folder name is important
I don't know who you're talking to - please be explicit.
Your code is still safe; a .vb file is just a text file, nothing more, so that code is all intact. As for 'what's important', it all is.
Still lost in code, just at a little higher level.
:-)
Yes the folders are important. You can change the folder the .sln is in but after that its like playing golf in a lightning storm. Best not to. IMHO. Best to stop now, go to your backup, try again doing it correctly whatever that is? Check it each time you make a change to see if VS went along with it.
Tuesday, April 14, 2015 6:28 PM
.vbproj is working correctly, so is the .exe so that's good i guess. It looks like just the .sln is having problems
Yes that is good.
How many forms are in your project?
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 6:28 PM
as far as I know the only thing I need to show is the .exe
could you find anything in any of my screenshots that has an inconsistent name? I can't think what else I may have changed. I don't suppose the folder name is important
I don't know who you're talking to - please be explicit.
Your code is still safe; a .vb file is just a text file, nothing more, so that code is all intact. As for 'what's important', it all is.
Still lost in code, just at a little higher level.
:-)
so if I changed the folder name it might work?
Tuesday, April 14, 2015 6:30 PM
Matthew,
CLOSE Visual Studio - now - and copy that entire folder somewhere. To your desktop is fine, but before you make any changes, save the whole thing somewhere safe.
*****
How many forms are there?
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 6:38 PM
to solitaire-
I copied and renamed the solution but there is no rename option when right clicking the name below the solution name- http://snag.gy/V5GTn.jpg
Tuesday, April 14, 2015 6:40 PM
to Frank-
I copied the folder to desktop and called it quadcopter booking system 2
I have 7 forms
Tuesday, April 14, 2015 6:45 PM
to Frank-
I copied the folder to desktop and called it quadcopter booking system 2
I have 7 forms
Good ... now I can exhale. ;-)
*****
Open Visual Studio and create a new project. Name it to whatever you want and save it. The next part will sound odd but it *should* work:
It will automatically create Form1 and open that in the designer view. Close it, then look in Solution Explorer and find "Form1.vb" and delete it.
Once that's done, in Solution Explorer, right-click and choose Add >> Existing.
When you do it will open a browser for you to select the files that you want to add to your new project. Browse to your old project and select the FormNameHere.vb files. Please do note that I don't mean FormNameHere.designer.vb files only, for example "Form1.vb" and "Form2.vb".
"Ok" your way back and save it ... press <F5> and hold your breath. ;-)
Let me know if that works please?
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 7:02 PM
I haven't read every post in detail (just skimmed the thread) so forgive me if this is already posted and doesn't apply...
The most typical issue is that there is a line inside the sln file which points to the project file. You have to edit this path inside the sln file if you rename the project file from outside of Visual Studio (easiest thing is to rename everything from within VS while the solution is open). The sln file is just a text file so you can edit it in notepad. Just open the file, find the path to the project (the file is typically short and easy to read) and modify the path to match the actual project file name, then save the sln file.
Reed Kimble - "When you do things right, people won't be sure you've done anything at all"
Tuesday, April 14, 2015 7:02 PM
to Frank-
The forms don't show
I take it you found "Add".
*****
First, confirm that they're there using Windows Explorer. If they are then my guess is that you need to click that spinner and change the filter (possibly to "All files").
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 7:24 PM
to Frank- me again, I accidentally closed the browser and forgot my password
which files did you mean? the .vb, .vb and designer.vb or those + the .resx?
I tried with just the .vb and it said something about form1 not existing, so I added the designer.vb and it said the same error
Tuesday, April 14, 2015 7:27 PM
to Frank- me again, I accidentally closed the browser and forgot my password
which files did you mean? the .vb, .vb and designer.vb or those + the .resx?
I tried with just the .vb and it said something about form1 not existing, so I added the designer.vb and it said the same error
I meant only the FormNameHere.vb files.
It will (or should) create the designer file for you. I'm honestly confused on what to suggest now - it's always worked for me although I am using an older version of VS, but that's always worked for me.
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 7:28 PM
to Frank- me again, I accidentally closed the browser and forgot my password
which files did you mean? the .vb, .vb and designer.vb or those + the .resx?
I tried with just the .vb and it said something about form1 not existing, so I added the designer.vb and it said the same error
You might try Reed's approach, and if it works then know that you still have work to do: You'll need to change the assembly name, the namespace, and a few other things but if that's the only option here, then that's just how it has to be.
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 7:37 PM
to Frank- me again, I accidentally closed the browser and forgot my password
which files did you mean? the .vb, .vb and designer.vb or those + the .resx?
I tried with just the .vb and it said something about form1 not existing, so I added the designer.vb and it said the same error
You might try Reed's approach, and if it works then know that you still have work to do: You'll need to change the assembly name, the namespace, and a few other things but if that's the only option here, then that's just how it has to be.
Still lost in code, just at a little higher level.
:-)
I got an error http://snag.gy/CWb8e.jpg
I'll have a go modifying the path but I have never done it before. I also don't know what a namespace is. http://cdn.overclock.net/c/cc/cc78e7df_japbcvpavbzau9dbuaxf.jpeg
Tuesday, April 14, 2015 7:40 PM
Matthew,
Back to what I suggested: When you did "Add >> Existing" and added Form1.vb, did it show up in Solution Explorer? It should have.
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 7:45 PM
to Frank-
All my form names have been changed from form1.vb, form2.vb etc to meaningful names like FrmLogin.vb.
I added all .vb and all designer.vb files and they showed in the solution explorer, but I got the error i posted a screenshot of
edit: I would really prefer to do this method than modify the paths, as it allows me to rename the files which was my aim before I got into the mess. Also making the shell and adding in the forms seems a lot easier than path making
Tuesday, April 14, 2015 7:50 PM
to Frank-
All my form names have been changed from form1.vb, form2.vb etc to meaningful names like FrmLogin.vb.
I added all .vb and all designer.vb files and they showed in the solution explorer, but I got the error i posted a screenshot ofedit: I would really prefer to do this method than modify the paths, as it allows me to rename the files which was my aim before I got into the mess. Also making the shell and adding in the forms seems a lot easier than path making
It may be that it doesn't know what the startup form is, but let's get there in a minute:
For any of those forms shown in Solution Explorer, right click on the form's name (in Solution Explorer) and choose "View Code". Does the code show?
Right-click again and choose "View Designer". Do you see the form in Design view?
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 7:55 PM
to Frank-
I'll try that next
Following your steps as best I could, I added the .vb forms however I get the form1 error at the bottom of the output screen
edit: I got the form designers, clicking it I got the code. Everything is there as far as I can see so I have no idea why it can't execute
edit2: just realised I did what you asked me to do but in a different way
Tuesday, April 14, 2015 7:59 PM
to Frank-
I'll try that next
Following your steps as best I could, I added the .vb forms however I get the form1 error at the bottom of the output screen
If it's looking to start up on Form1 and Form1 doesn't exist ... that would explain it.
Let me know your findings about seeing the code and seeing the forms in design mode.
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 8:01 PM
Frank
I can view the code and the forms, no other errors except for looking for form1. would creating form1, running the project then deleting it work?
Tuesday, April 14, 2015 8:24 PM
to everyone- started it and it worked, added the notepad files I wanted to open to the file, moved it to the correct place and I'm pretty sure it's 100% working :D with the extra bonus of having a decent name like I had originally intended
I don't know how this will get closed though as I forgot my first account's password
edit: extra thanks to Frank you've been really helpful :)
Success!
Great! :)
... now don't do this again. ;-)
Still lost in code, just at a little higher level.
:-)
Tuesday, April 14, 2015 8:30 PM
yep from now on i'll make sure to name things when i create them :)