"There is no editor available for ../Form1.vb" error? - vb.net

I was happily using VB.NET, saved, and, well, there was a blackout.
Probably lucky? Well, now I open my project just fine, double click the Form1.vb and.... "There is no editor available for ../Form1.vb, make sure the application for the file type (.vb) is installed."
.......... Did something go wrong with my project? Is it dead?
Windows 7, Visual Basic 2010 Express.
What should I do?

The same thing just occurred to me but I couldn't get it fixed trying the previous answers. For some reason, one of my references Microsoft.Office.Core had a yellow exclamation point on it.
Simple Solution
Solution Explorer
Expand References
Right click on the item with "Yellow Triangle w/ "!" point"
Select "Remove"
Open the "Build" Menu at the top
Select Rebuild "filename"
Once this was done, I could open my forms correctly.

It's difficult to imagine what you're seeing. I've seen plenty of cases where the design view won't open for whatever reason, but I've never been unable to view the code for the form.
First thing to try is navigating to your project folder in Windows Explorer, right-clicking on the Form1.vb file, and trying to open it in Notepad. This is pretty much the ultimate test. If you can open it in Notepad, your work is salvageable. If not, the file is corrupted and your best bet is to start over. I suppose if you really feel that you have a lot invested, you could try various file recovery techniques, but considering it's a single form file, I seriously doubt it's worth the time or expense.
If that succeeds, and you can open the file in Notepad, select all the code and copy it to the clipboard. Now go back into Visual Studio, and add a new Form to your project. Delete everything in the new form's code file and paste the salvaged code from your original form back in. You still won't be able to open the form in the designer though, and you'll likely be missing references to all of your controls. Ignore all those squiggly underlines for now.
To fix that, you need to go back to Windows Explorer, and find a file named Form1.Designer.vb. This is the partial class that the designer saves information into; it contains declarations for all of your controls and the properties you set for those controls at design time. Just as before, right-click on this file and open it in Notepad. Select everything and copy it to the clipboard. Now go back to Visual Studio, and click on the "Show All Files" button at the top of the Solution Explorer (hover over them to read the ToolTips). You'll see a bunch of extra junk show up, but what you're primarily interested in are the drop-down arrows that just appeared to the side of every Form class. Expand the new form you added in the previous step, and find it's .Designer file. Delete everything that's in there now, and paste in the code from your salvaged form's .Designer file.
You now have an exact copy of your old form in your project. You can delete that old, corrupted form file, because you're no longer using it. You'll also probably want to change the name of the new file itself by right-clicking on it in the Solution Explorer—right now, it's named Form1 just like your old form, because it's an exact copy of that form. The code says it's name is Form1 and couldn't care less about your file name. Clean and rebuild your project, and if things go your way, everything should be back to normal.

Windows 7/ Vista:
Try right clicking the .vb file and selecting the "Previous versions" tab. When the list has loaded (if it has) select the most recent file from the list and select "Restore". Now reload your project, try doing this with all of the form files, e.g. "Form1.resx" and "Form1.designer.vb" and "Form1.vb" and then reload the project.

It implies that the file is corrupted.Replace an uncorrupted copy of that file in the corresponding directory and then try.

I had the same problem and it was from a bad reference to Excel caused by copying the project from a Win7 machine to a Win8 machine probably.
Open the solution explorer and expand the references You will see two references with the yellow exclamation mark icon beside them indicating a problem - Microsoft.Office.Core - Microsoft.Office.Interop.Excel Right click on both these icons and click remove Your form should load now, if not, save the project, close it then reopen it.

i have this problem too . when i restart Visual Studio the form create successfully and show it's designer.

I've created the Form with a different version of VS, other than 2012 (eg VS 2010, VS 2013, VS 2015; I've used VS 2015). Save the Form in the solution, open the solution with VS 2012 and include the form in the solution. It worked for me.

To fix the problem you need :
1) NotePad++
And you should follow this simple steps :
1) Close Visual Studio .
2) Go to the Backup Folder of your VS version usually in : "C:\Users(your user name)\Documents\Visual Studio (year)\Backup Files\your project or application name" .
3) Open the last Backup file of your corrupted file , usually the name format is : "Recovered-month.-day-year-time.(Your File Name).cs" with NotePad++ , and copy the source code .
4) Go to your corrupted file in the project folder and open it with NotePad++ , Edit => Select All => Past the source code and Save .
5) Go to windows start list and search for : "Visual Studio Tools" folder , open it and double click on : "Developer Command Prompt for VS(year)" .
6) Write this two codes in the Developer Command Prompt : "devenv.exe /setup" and then "devenv /resetskippkgs" .
7) Open your project .
Note : if this didn't work for you try to do the steps before in this arrangement :
1) => 2) => 3) => 4) => 7) => 1) => 5) => 6) => 7)
and your problem will be fixed .
It works 100% for me , i hope this will helps you

Try changing the security permissions on the form affected. Right click the file, go to properties then security and change the access ability to everyone.

Related

Copy and paste form into project is not working

I accidentally deleted my form file, so I restored through Recycle Bin. However, I found that it's not in my project so I selected [Projectname].vb, [Projectname].designer.vb, and [Projectname].resx in 'Add Existing Item' dialog in Solution Explorer. It was successfully added, but I found that there's thousands of errors that show me things are already declared. And all thing in designer.vb not applied to designer. So I tried delete form files and add again, add .vb file only, etc. But not working at all, and it came even worth, so designer even not open now! Error while showing Designer Photo
Error in designer.vb
Thank you.
If you are trying to copy files from windows explorer. you should copy the three vb file.
In Visual Studio, just add the base .vb file
Just press Ctrl+D or right click your project -> Add -> Existing Item

Visual Studio Error Cant open source code of my form

enter image description here
I was working on my project about 4 hours and after I am done with it I saved it and try to rename the form name bu mouse right click ! after that it gave me like that error even I cant open my source code :( is there any why that can I save my codes at least.
in addition : when I press build it builds with no problem and I can use it.
I guess there was an visualstudio error, It changed the form name but didn't update successfully to the .csproj file. You can fix this issue by opening the .csproj file and edit it (by notepad or any text editor) or unload project and edit it, find the name of Form and mame sure the path to the form and form name is correct
Hope this helps!

Save Aptana Studio 3 project explorer state on close

I'm sure there is a simple option for this but I have as yet been unable to find it. Every time I close and reopen Aptana Studio 3 it collapses all the folders in the project explorer and I have to reopen them all, is there a way to get it to leave them open and save the project explorer's state when I close the program?
Thanks.
I cannot find any way to keep the state of the Project Explorer. However, using the App Explorer, the state of your open folder will be preserved. You can also try the "Navigator" which looks just like the Project Explorer, but appears to keep state. I will add the proviso to that: It kept state when I restarted aptana, but it also developed a GUI glitch where it appears to be scrolled to the right so I only see the right half of all of my file names and I cannot fix it, so this may not be a good option if you get the same glitch.
There is also a method which does not do quite what you ask, but may be a good fix for you anyway. If you click "Link with Editor" picture (two yellow arrows) in the Project Editor, it will automatically expand your project hierarchy to match whichever open file you have active. Since your files stay open when you close Aptana, this would keep the Project Explorer expanded to whatever you are looking at even on restart. See this question
You can also set up working sets for various parts of your code that are buried in the hierarchy and use the Project Explorer to show those working sets instead of you projects. This does not save state, but it does give you easy access to common parts of your code that may be deeply buried.
Hope one of these helps you.

Changes in the code or the designer won't update when debugging

I am trying to debug my VB.net app in Visual Studio Express 2010, when I realized my changes will not update on my form-on the designer or in the code. After looking online, I found that you should clear out the "Debug" folder under the bin. That worked-for only one time. Now it went back to the older version and when I delete it again, it doesn't change. When I build the project and run it from the "Release" folder, it works perfectly, but when a error occurs at runtime, it won't show where the error is because it is running independently.
Thanks in advance.
(I have Windows XP SP3)
I had the same problem. Frustrating problem....? Close the project, go to debug bin/folder, delete these files, reopen project and rebuild it (F5).
- .exe
- .pdb
- .vshost.exe
- .vshost.exe.manifest
- .xml
it works 99.99%.......thanks
Before I'd create a new project, I'd copy all of the code-behind (including the code that creates the controls that you're not supposed to touch) into another form. That may be all you need to do. Try compiling that form and running it and see if it's good. If so, you won't have to create a whole new project and can just delete the old form.
I would think there's something causing this that would be much easier to to fix. Are there any config files or anything like that? Are you building to the right location?
It's been a while since I've done winforms, but I remember this happening in VS 2005 and I just created a new form and copied the code-behind into another winform and compiled.
Hope this helps.
mmm... if it was for me, with such a weird bug, i would create a new project then insert the files (not as a link, but a copy) in the project, and i most likely all will work fine after... Faster than finding where-the-hell is that wrong parameter...
So how do you do that ? Well create a new project, choose the folder and name, change namespace in settings if needed, then in project explorer Add existing item, then Browse and select your code and xaml (and other maybe) files. Let us know.
This happened to me as well. I believe the /bin and /obj folders of my application must've been locked for by some other application. Before manually deleting them I tried running Visual Studio as an administrator and did a Clean and a Rebuild which worked. If it doesn't work for you, try deleting the folders manually.
Close VS
Press Ctrl + Alt + Delete
Choose "Task Manager"
In the "Process" tab in "Task Manager" find your "ProjectName.EXE" and click "End Task"
Restart VS
I have the same problem, but i changed the solution config next to the start button from debug to release and that fixed my problem, try it :)
"Save all" works for me in VS 2010 VB, in Debug and Release mode.
I put the "Save all" icon next to the Run and Build icons.
First make sure your Localizable Property of you form is set to FALSE

View Designer Code in Visual Studio 2010

What is a standard way to open the Designer (automatically generated) code for a VB file?
As a workaround, I can get to it by searching the entire solution for some keyword that is usually only found in those files: Global, Partial, etc.
Open the Solution Explorer. Along the toolbar at the top there is a tool Show All Files (it is the 2nd from the left on my version of visual studio). Click on that tool. All of your Form files will now have an arrow beside them. click on that arrow to expand. Look for the code file named FormName.designer.vb. Double-click on it to open.
You have to click the "show all files"-Button. Then you can also see the Designer.vb-files.
Note: For C# and VS 2008, but the same applies to VB in VS 2010.
http://peterkellner.net/2007/12/31/visualstudioshowallfiles/
http://blog.brianhartsock.com/2009/09/14/visual-studio-tip-show-all-file/
Keyboard shortcut for Show All Files
Show All Files is a useful little button in the Visual Studio solution explorer to give us a full view of the directory structure our project files are sitting in. When it is off, we only see the files that are explicitly included in the project, but when it is on, we see everything. This makes it very easy to explicitly opt a file into the project without doing an add -> existing item -> find existing item in directory structure and add to project.
The default when creating a new Visual Basic application in Visual Studio is to not show all files, and unfortunatly there is no setting you can adjust to change that.
Open the code file, and in the top-right corner of the code window is a drop-down containing all methods. Open this and select "InitializeComponent".
A screenshot from a newer version. Visual Studio 2015 and 2017 will look like this.