Changes in the code or the designer won't update when debugging - vb.net

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

Related

Project Properties Windows Blank in Visual Studio 2022 Community 17.1.0

I'm trying to access the project properties but the window appears blank. I've tried web solutions View>Properties Window, f4, right click on project folder>properties, Also tried resetting import/export settings, searching for specific tab
everything results in a blank window.. Any help is appreciated!
Thanks in advance.
I ran into this same problem with VS 2022 v17.4.0 Preview 1.0 in a C# Windows forms app. Closing and opening the solution/VS didn't have any effect.
After I closed all the open tabs and reopened a file, the Properties pane was populating correctly.
Does your toolbox items also appear 'greyed out'?
Try Going to your Build Menu and select
Clean Solution
(and perhaps Rebuild afterward - or not)
This happens constantly on my install. I simply minimize the entire VS window, then restore it. Poof! My properties appear. Trivial, but painful.
1 Make sure that your build program is not running (use task manager to end that process if needed) and make sure that you can rebuild your project without errors.
2 Restart Visual Studio as an Administrator.
Good Luck For You All ^_^
I have just encountered this error and it was simply solved by closing the visual studio and reopening it again. it is just gone.

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.

File changes do not show up in Visual Studio Code (VSCode)

I'm experimenting with VSCode(specifically version 1.17.1),
and I noticed if I change the content of some files programatically, the updated content doesn't appear immediately and I need to close and reopen the file!
Is this a common issue with VSCode, and how to solve it if there is any solution that doesn't involve a refresh command or a key binding like alt+f5.
Thank you in advance.

Why doesn't Visual Studio debug my VB.NET application?

I recently have encountered a weird issue with my project: as soon as I click debug and it builds the project, it stops debugging. There isn't any error message, or anything else that comes up, including the form itself.
I've tried messing with the settings: no splash screen and I've even changed the startup form to a blank Windows form. What could be causing this problem? Is it Visual Studio or my code?
Probably your program is exiting normally. Set a breakpoint at the first statement to be executed, press F5, then single-step through the program until you get to the last statement executed.
If the first statement is never reached, then one of two things probably happened:
You're mistaken about which statement is executed first, or
The program is terminating during initialization, probably because a class constructor is exiting the program either normally or abnormally.
A few ideas:
Use Debug->Exceptions, and check all the checkboxes so you break when an exception is thrown.
Use Debug->Step into to step into your code.
Then you can use Step Over and Step Into (look at the menu for the keyboard shortcuts)
I found a solution, but not the problem.
How I fixed it:
I just created a template for each form, created a new project, and imported everything into the new project. One thing that I found useful is in the new project is to add an existing item (CTRL + D), and group select (maybe, don't know if you can) and select all the non-code/form/designer/etc. files (like text files or images) and then import them.
I have found a possible solution after I had the same problem.
You probably have more than one project in your solution (The main project, plus an "InstallShield" project",perhaps)
Make sure you have the main project set up as "Startup Project".
In the Solution Explorer, right click on the Main Project and select "Set as Startup Project".
Everything will then run OK.
If you get the error like: "The debug mode is program but there is no program specified....." Go to Solution Explorer then Right Click on main project's name and Click on Set as StartUp project. You can debug your program.

"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.