Error when trying to open the "My project" tab in vb - vb.net

Hi there im currently trying to swap my startup form from TillSystem.vb to Form1.vb however when I try to enter My Project to do this through the menu it appears with the error below
any help on how to fix this would be appreciated many thanks

Because there are errors in the design file. In the Solution Explorer click on the Show All Files button and open the TillSystem.Designer.vb file.
Check this file line by line, if you are not sure which line is wrong, comment out and try again till you find the problem.

Related

Xamarin - Error IDE1100 Error reading content of source file

I've made a new content page, but forgot to type the name.. So I deleted it an made it again with proper name..
I have done it like this multiple times already, but this time something went wrong and I cannot compile.
I have this error message:
Severity Code Description Project File Line Suppression State
Error IDE1100 Error reading content of source file
'C:\Users\shark\source\repos\GalShare\GalShare\GalShare\Views\Page1.xaml' -- 'Could not find file
'C:\Users\shark\source\repos\GalShare\GalShare\GalShare\Views\Page1.xaml'.'. GalShare-XamlProject
C:\Users\shark\source\repos\GalShare\GalShare\GalShare\Views\Page1.xaml 1 Active
I have done nothing except the steps above.. What is the cause of this error and how can I fix it?
Cleaning the project did not solve, but closing and reopening solved my problem.
In addition to the answers of E.Zhao and messyprogrames, here a step-by-step walkthrough.
Clean Solution:
Navigation Bar > "Build" > "Clean Solution"
Unload project:
Choose your "problem project" on the right side within the solution explorer. Right mouse click > "Unload Project"
Reload project:
Choose your unloaded "problem project" again. Right mouse click > "Reload Project".
Opening and closing the solution wasn't helping, but unloading and reloading the project worked.
Actually, it is unnecessary to exit and reopen current solution, try to clean the error project, unload and then reload it again. hope it works for you.
In VS click your initials > Account Settings > and check there's no warning there asking you to re-fresh your credentials. It was this for me. After I re-entered my credentials, cleaned and rebuilt all was fine.
Unloading and reloading the project worked for me.
To reproduce this, in a new folder add a WPF user control with a accidental typo.
Rename with F2 or simply rename,
the code behind doesn't rename, so change that.
Initalize component gets a good old red squiggly!
create a new one with an appended number as you want to crack on...
delete the user control that you originally created.
You will get this error (well I did on enterprise edition Version 16.7.2)
Then as other contributors have suggest, remove the pain by unloading and reloading the project.

How to run program in vb.net without the solution file?

Currently I have a .vb file only and the debugging button shows "Attach" instead of "Start". How do I fix this? Thank you in advance.

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!

A project with an Output Type of Class Library cannot be started directly --> vb.net

I did much R & D on the above issue, and I got to know is, change the current project to "Set as StartUp Project" by right clicking on the solution. As the same I followed, could not make my solution to run properly. Can anybody help me please.
Here is the error dialog box appearing to me when I click to run the code.

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

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.