When debugging in VS I step through the code but the when I move my mouse over variables and properties it shows nothing.
For example:
If I hover my mouse over StoreId it should display the value. It doesn't though, however, if I I hover my mouse over myStore it displays the above?
It's like it cant map the properties to the object in run time.
Any ideas what's going wrong?
Thanks
Check that you haven't enabled any optimizations in the build options.
Optimizations can lead to whole variables being removed from compiled code, instructions being executed in a different order than initially expected...
This problem was addressed in the SP1 release of VS2O10, did you install it?
Related
I am not sure did they change it the way we can do it or is there any simpler way or they actually removed the option and limited us to use code instead
in vs 2019 if we double click the button we directly went to click event of a button and then from the upper right dropdown box we can easily move to any other event of a current object like double click or mouse over etc which automatically created the event handling SUB
but I am not able to do it in the VS 2022 so what happened with it?
as you can see in the attached images
I'm truly hoping that it's a bug in VS2022 because I'm really missing this function too. I've found a lot of topics in the official discussions and feeds and it seems that different older versions have the same issue, but they have already patched them. No info about 17.0.x version. :( I'll investigate further. Please report if somebody find a working solution.
Go to Options->Text Editor->(your language) and enable "Navigation Bar".
Previously answered here:
Visual Studio window which shows list of methods
This bug has been fixed in the latest version of the VS 2022 as per below post. Just tested and seems to be working as it used to!
https://developercommunity.visualstudio.com/t/event-drop-down-menu-in-the-upper-right-corner-of/1579215
well finally I found the answer to my question with thanks to mrtn
Microsoft finally found the bug and fixed the Asked Issue in question, so New update will solve this problem that was a bug from VS 2022
Additionally, I want to mention there is another way to create/edit Object's Events from Design view
Go to the design view and then click the Button with Lightning icon, a list of Events will Appear, and then go for the desired event and double click to add the event or edit it
Can someone help me figure out the most suitable debugging features in visual studio for my problem below please. I'm coding in JS and have a line of code below
listView = utils.query("#termTest");
ui.setOptions(listView, {
itemDataSource: publicMembers.itemList,
itemTemplate: utils.query(".itemtemplate"),
oniteminvoked: this._itemInvoked,
})
My application runs fine and doesn't cause an error however my data isn't being bound to that listview making me assume that for some reason it's not querying or finding the right element of the DOM. How do I found where it is actually pointing?
Have you tried using the watch feature, rather than just mousing over?
You can set a variable in the watch window, right click it and set it to break when that value changes.
This should enable you to easily see when this value changes.
In VS2005 you should be able to click Debug->Windows->Memory->Memory<1,2,3, or 4>. However in my VS there is no memory item in the Debug->Windows drop-down. Has anyone ever experienced this before or know how to fix it?
It's possible that the visual settings are simply hiding the memory window. I know at least one of the VB.Net profiles does this. You can get it to display be executing the following command from the Command window while the debugger is running
Debug.Memory1
Maybe you have a free version of VS?
I am having a problem thats not about the code, it's about the screen in Microsoft visual studio 2008.
Actually problem is i created one utility from couple of weeks i didn't opened that utility today i opened (in Microsoft visual studio the screen appearing blank no controls are visible in that.But all the controls properties are there. I tried a lot but i didn't get solution. Last when the same thing happened i created the controls again. Now i don't want to go to create all the controls again. If any one have the solution please help me.
Before screen is like this:
Now its blank (like new page)
From your description I'm not sure if this is a application/code build issue or an IDE issue, what you could try is to reset the settings in visual studio and see if this helps.
You can do this by going to Tools -> Import/Export settings and then following the wizard to reset the settings, you may also want to perform a backup before resetting them (this is also part of the wizard) then they can be restored if this causes you further issues.
I don't have a copy of 2008 available at the moment so some menu entries may be slightly named different.
Hope this helps!
EDIT:
Now there is more information, this looks like there may be a problem with the code in the
InitializeComponent
method of the form.designer file (e.g. if you are using c# this would be something like Form1.Designer.cs and can be found by expanding the corresponding form in the solution explorer), if you remove/comment the lines that say
this.Controls.Add(this.NameOfControl)
(NameOfControl is where you would see your declared controls name)
then you get the behaviour that you are seeing, the controls do not render as they are never added to the forms controls collection but as they are declared you will still see them in the properties drop down and wont be able to add another control with the same name.
Is there a good way to debug errors in the Visual Studio Designer?
In our project we have tons of UserControls and many complex forms. For the complex ones, the Designer often throws various exceptions which doesn't help much, and I was wondering if there's some nice way to figure out what has gone wrong.
The language is C#, and we're using Visual Studio 2005.
I've been able to debug some control designer issues by running a second instance of VS, then from your first VS instance do a "Debug -> Attach to Process" and pick "devenv".
The first VS instance is where you'll set your breakpoints. Use the second instance to load up the designer to cause the "designer" code to run.
See Debugging Design-Time Controls (MSDN).
It has been a pain in 2005 and still is in 2015. Breakpoints will often not hit, probably because of the assemblies being shadow copied or something by the designer(?). The best you can do is to break manually by introducing a call to Debugger.Break(). You may wrap it into a compiler conditional as so:
#if DEBUG
System.Diagnostics.Debugger.Break();
#endif
int line_to = break; // <- if a simple breakpoint here does not suffice
I have had this happen many times and it is a real pain.
Firstly I'd suggest attempting to follow the stack trace provided by the designer, though I found that often simply lists a bunch of internals stuff that isn't much use.
If that doesn't work then try compiling and determining the exception from there. You really are flying blind which is the problem. You could then try simply running the code and seeing what exception is raised when you run it, that should give you some more information.
A last-gasp approach could be to remove all the non-generated code from the form and gradually re-introduce it to determine the error.
If you're using custom controls you could manually remove the generated code related to the custom controls as well if the previous method still results in an error. You could then re-introduce this step-by-step in the same way to determine which custom control is causing the problem, then go and debug that separately.
Basically as far as I can tell there's no real way around the problem other than to slog it out a bit!
I discovered why sometimes breakpoints are not hit. In the Attach to Process dialog, "Attach to:" type has to be "Select..."'d.
Once I changed to "Managed 4.0, 4.5", breakpoints for a WinRT application were hit. Source: Designer Debugging in WinRT.
Each one is different and they can sometimes be obscure. As a first step, I would do the following:
Use source control and save often. When a designer error occurs, get a list of all changes to the affected controls that have occurred recently and test each one until you find the culprit
Be sure to check out the initialization routines of the controls involved. Very often these errors will occur because of some error or bad dependency that is called through the default constructor for a control (an error that may only manifest itself in VS)
You can run a second instance of VS and attach it to the first instance of VS (Ctrl+Alt+P). In the first instance set the breakpoints, in the second instance run the designer, and the breakpoint will fire. You can step through the code, but Edit-and-Continue will not work.
For Edit-and-Continue to work, set you control library's debug options to run a VS with the command line argument being the solution filename. Then you can simply set the breakpoints and hit F5. It will debug just like user code! As a side note, you can do this will VS and Office add-ins also.
This worked for me for Visual Studio 2022:
I opened a second Visual Studio instance
In the second instance I clicked Debug -> Attach to Process...
I selected DesignToolsServer from the process list
More details: https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/walkthrough-debugging-custom-windows-forms-controls-at-design-time?view=netframeworkdesktop-4.8