In visual studio 2010 if I add a watch to a property of an object, by right clicking the property and going to add watch, in the watch window it just adds the property name instead of object.property name and hence it will also show "xxx does not exist in the current context".
Am I going about this the wrong way or is this a bug in visual studio?
I can get the watch to work by typing object.property manually in the watch window but it seems to defeat the whole purpose of that menu item being there.
I would suggest that you should select the object.property completely and then add it to the watch window.
Related
I am having trouble finding the right-click context menu in Visual Studio 2015. I know that nothing is wrong with my project or the file I am working. I can find the right-click context refactor menu in Visual Studio 2013. However, in Visual Studio 2015 there isn't a refactor context menu in the right-click context menu.
Where did it go? How do I get it back?
Your suggestion cannot include menu Edit → Refactor.
I have tried to reset my Visual Studio settings back to default using menu Tools → Import and Export Settings and that didn't bring the menu back either.
Some of the refactoring tools have been relocated or are at least accessible in a different manner than they were previously.
Using the extract method refactor as an example, you can still use this function; it is just not done the same as before:
Right click
Quick actions
Click extract Method
I think they've changed it to feel more "ReSharper"ey. All of the functionality should still be there however.
Here's more information on refactoring in Visual Studio 2015 - hopefully this helps! Refactoring (C#)
You no longer need to access the refactoring using the mouse right click.
It is recommended that you use the keyboard shortcut keys within Visual Studio.
For all possible shortcut keys, see Default Keyboard Shortcuts in Visual Studio, Refactor.
You might need to build the project to get it to work.
See Code Editing ASP.NET Web Forms in Visual Studio 2013 | Microsoft Docs. (If it is missing then the point is that I am using an example provided by Microsoft.). In Refactoring and Renaming see To extract a method in a C# page. When I follow the instructions I cannot find the feature to extract the code to a method. When I tried the Edit menu it said I did not have valid code. Then I built the project and the feature to extract the code was available and worked.
If you change the name of the object you are refactoring, the light bulb then appears to the left which asks if you wish to change the name of the object (i.e. refactor) or generate a new constructor for the new named object.
Ctrl + . is the shortcut key for extracting a method in Visual Studio 2015 and onward.
Ctrl+M, R does not work anymore in new versions.
Sometimes when I open my Visual Studio form designer, I see the [Add] text to create a new BarButtonItem, other times I don't. This has led me to search for a way to create a new button several times now. Any idea what might be causing this?
Try to right click your bar manager, and check the Show DesignTime Enhancements.
Here is a link that may help.
I'm writing a Visual Studio extension that allows editing the properties of an object in the Properties Window. I use the ITrackSelection interface to select the object I want to edit, and it all works fine, the properties are shown in the window and I can edit them.
However, I can't make Visual Studio refresh the Properties Window when a property is changed externally. I tried implementing INotifyPropertyChanged, but the PropertyChanged event is never subscribed. I also tried implementing ICustomTypeDescriptor and returning custom PropertyDescriptor objects with overrides for AddValueChanged and SupportsChangeEvents, but those are never called.
What I'm missing? How can I tell Visual Studio that a property of my object has changed and the Property Window has to be updated?
IVsUIShell.RefreshPropertyBrowser should do the trick and update the Property Window.
When I debug my web project I start with an empty Watch window and I have to add all data myself.
When a friend of mine showed me how to debug with Visual Studio he got all Watch values automatically filled in the window.
How do I get my Visual Studio to autofill my Watch window with all available values?
Your friend might have shown you the Locals window or the Autos window. They are both available through the Debug window, and automatically show you the relevant variables. The Watch window, on the other hand, is supposed to come up empty and let you fill in expressions by yourself.
This takes relatively long time to save edmx.
Any help will be appreciated.
Btw, I do not know if this is behavior added to studio by some add-in!
There is a property, on ConceptualEntityModel's properties, called Transform Related Text Templates On Save.
(Right click on empty surface on designer and click on properties)
I just had to make it False!