Visual Studio 2010 Bookmarks problem - visual-studio-2010

When I create bookmarks into editor code with Bookmarks window, work for a while adding methods, removing statements etc. and then I reopen the IDE the line number for bookmarks are wrong...
Any idea?

One way to work around this problem is to not close visual studio before finishing writing your code. The bookmarks will update if the program is still running, but will show the wrong lines if loading a save file.

Related

Viewing binary files in MSVS under Windows 10

For ages I've been using MS visual studio 15 to view binary files, simply by doing file|open. My files have a custom extension, 'SQ3', but VS seemed to happily infer that they aren't text, and display them as binary. However, Win10 seems to have stopped that. Now if I do the same thing, a popup appears, asking me whether I want to find an application from the shop, or always use this application (presumably MSVS, the one I'm invoking from). There's a proceed button, but it doesn't respond. There seems to be no way that I can get VS to open and display the file.
Is there a way to stop the OS intervening so VS can do its thing?
Incidentally, having to rename files would be extremely inconvenient in this situation. TIA
Thanks, that's perfect.
In Visual Studio go to Tools/Options/Text Editor/File Extensions.
Add new entry to the list:
Extension: sq3
Editor: Binary Editor
Click Add and then OK to close the dialog. Files with .sq3 extension will now open with the hex editor when opening them or dragging them to Visual Studio.

Visual studio reopen editor after debugging

I started debugging (some C# MVC application) and a lot of windows pop-up. So I closed all of them. But I probably change something.
Now when I have open some files in editor and press Debugging - it close them. After Stop debugging they are still closed. When I try to double-click on file in Solution explorer - nothing happen. Right click and Open - nothing. Only when right-click - Open with... and select another editor, it will open. Sometimes it ask that file is already open and if I want to close him. So it is probably open somewhere.
Any ideas how to fix it? I tried reset all setting, imported old environment, restarted Visual Studio and also computer and nothing helped.
Thank you for help
You can try to Reset Window Layout from the main Window menu in normal and debug modes.
so finally I installed new VS 2015 and everything works as normal

"Cannot navigate to definition" annoyance in Visual Studio 2010

I just switched to Visual Studio 2010, and now whenever I select something, Ctrl+C to copy, click somewhere else, and Ctrl+V to paste, I get an error message "Cannot navigate to definition." After that, it I try it again, it works. What fantastic new 'feature' should I be turning off to stop this?
Bah, it's a bug in Microsoft Productivity Power Tools for Visual Studio 2010. the "Ctrl+Click Go To Definition" feature. Apparently, when I click a new location and then press "Ctrl+V" - if I do it quickly enough, it interprets it as a Ctrl+Click and immediately tries to trigger a navigation, even if I clicked on an empty space. The error comes because it doesn't know what I'm trying to navigate to (answer: I'm not).
I have/had similar issues in VS 2012 (Premium).
I've tried the following:
removed all bin and obj folders from project's folder: works most of
the time.
repaired VS 2012 (add/remove bugrams (programs) > repair). Didn't
help much.
Close and opened VS 2012: didn’t help much either.
I've noticed than I couldn't open only files that weren't check-in in
TFS. I check-in them and then VS started working normally.
Dunno if this issue will appear again tough.
Hopefully this would help someone.
BR
you can remove the GoToDefProPack.dll file from the following location:
C:\Users(myUserName)\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\Productivity Power Tools\10.0.20318.14
to disable this feature completely.

Can't "go to declaration" in *.ashx files (Visual Studio 2008)

When I open *.ashx files in Visual Studio, I don't have the helpful "Go to Declaration" context menu when right-clicking on a function.
How can I restore this functionality (this is a new install)?
Thanks very much.
Click on the text you want to go to and key F12 if it's not showing up for you.
Much like Windows Operation Systems need to reboot when things start breaking down, Studio sometimes needs a restart if that doesn't work.
Obviously this doesn't get your menu item back, but it's a fix that you might prefer over selecting that from the right-click mouse menu.
This is a shot in the dark since I do not work with ASP-related stuff.
Short Answer
If your *.ashx files belong to a project, open the project first.
Longer Answer
Most of my work in Visual Studio 2008 is with C++ and C# code. If I open a .cpp file or .cs file in VS2008 independent of the project it belongs to, VS2008 doesn't give me the Go To Declaration context menu either. When I open files independent of the project they belong to, VS2008 (or any Visual Studio version for that matter) is little more than a glorified editor. To get the benefit of Go To Declaration and other features, e.g., Intellisense, I have to first open the project and then open the file from within VS2008.
Alternate Answer
If you are already doing this, you might try deleting the .suo file in your project directory and letting VS2008 re-create it.
Apology
Sorry if this was simply stating the obvious. I know I've been frustrated at times when I've opened a file outside the context of its project only to realize what I want to do requires me to open the project anyway. Someone new to Visual Studio might not realize the project is sometimes required.

Is there anyway to tell Visual Studio not to open all the documents when I load solution?

When you open a solution in Visual Studio 2008 (or ealier versions for that matter), it opens all the documents that you did not close before you closed Visual Studio. Is there anyway to turn this functionality off, or a plugin that fixes this behavior? It takes forever to load a solution with 50 files open?
Have you tried deleting the .suo file?
It's a hidden file that lives beside your solution (sln) file. suo is "solution user options", and contains your last configuration, such as what tabs you left open the last time you worked on the project, so they open again when you
reload the project in Visual Studio.
If you delete it, a new 'blank' suo file will be recreated silently.
You can automate the process of closing all the files prior to closing a solution by adding a handler for the BeforeClosing event of EnvDTE.SolutionEvents -- this will get invoked when VS is exiting.
In VS2005, adding the following to the EnvironmentEvents macro module will close all open documents:
Private Sub SolutionEvents_BeforeClosing() Handles SolutionEvents.BeforeClosing
DTE.ExecuteCommand("Window.CloseAllDocuments")
End Sub
Visual Studio 2008 appears to support the same events so I'm sure this would work there too.
I'm sure you could also delete the .suo file for your project in the handler if you wanted, but you'd probably want the AfterClosing event.
From Visual Studio 2017 Update 8 there is an option in projects and solutions which you can use to enable this:
ALT-W-L
That's the key combination to close all open tabs, which can be pressed before closing a project, unless you prefer clicking Window | Close All Documents before closing the project.
--Gus
I dont think there is an option for this (or I couldnt find one) but you could probably write a macro to do this for you on project open.
This link has some code to close open files which you could adapt:
http://blogs.msdn.com/djpark/
I couldnt find the answer to this particular question but a good link for ide tips and tricks is:
http://blogs.msdn.com/saraford/default.aspx
Alternative answer:
Before you close your solution, press and hold Ctrl+F4, until all windows have been closed.
VS attempts to save the last known view. Other than the scripts mentioned above you can manually close all documents before exiting VS

Resources