"Cannot navigate to definition" annoyance in Visual Studio 2010 - 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.

Related

Updated toUnity 5.4.f2f - VS Autocorrect stopped working

I reecently updated my Unity editor from 5.1 to 5.4.f2f, and my IDEs started misbehaving. I use Visual Studio 2015 Community, and when I updated its Intellisense stopped recognizing all Unity terms. When I open scripts from the Inspector, VS opens nothing first, and open the script with broken Intellisense if I try and open it a second time. Monodevelop also cannot recognize any Unity terms. When I try and "Open C# Project," Visual Studio opens nothing.
The Unity editor also keeps on mentioning in the Inspector that GameObject scripts are missing too.
I'd really appreciate some help here guys. Keep in mind that I've also accidentally pressed the "Publish" button at the bottom of the VS window, but It was after the issue surfaced, so I'm not sure if it has any ties to this.
I think I solved the Problem.
It involved manually opening the Unity project in Explorer and opening the projects .sln file.
Apparently, this is a Windows OS flaw.
I got this answer from This link

Prevent Visual Studio to scroll to the end of file when pressing Ctrl A (select all)

It's basically in the title.
Whenever you "select all" in the Visual Studio code editor, the editor will scroll down to the bottom of the file. Is there a way to prevent this?
I'm using Visual Studio 2008 at the moment, but this applies to all versions.
No, you cannot change this behavior.
Microsoft has been aware of this since at least VS 2010, but either doesn't think it's a bug or doesn't think it's important enough to fix.
From their response to a 2010 bug report filed on the issue:
We unfortunately do not plan to change Ctrl+A's scrolling at this
time, so we're unfortunately resolving this issue as Won't Fix for VS
2010. However, it will remain in our database to be revisited for a future release of Visual Studio.
Source: Microsoft Connect
A quick Ctrl-Z-Ctrl-Y will get you back to where you were. If you tend to do a Ctrl-S Ctrl-A Ctrl-C a lot then just get used to this whole chain instead: Ctrl-SACZY. Or, create a macro: https://msdn.microsoft.com/en-us/library/a0003t62%28v=vs.90%29.aspx
I was struggling with this myself, but the "undo" suggestion gave me an idea and I feel kinda dumb for not thinking of it earlier. Visual Studio includes "Navigate Backwards" and "Navigate Forwards" buttons (CTRL-, and CTRL+, respectively). So after you finish selecting and copying, simple click the navigate backwards button or type CTRL- and voilà! you're back where you were.
I know it doesn't stop the scroll to begin with, but at least it puts your cursor back exactly where you left it!

How to revert file in Visual Studio 2010 (reload the file from disc)

I'm starting to use Visual Studio (2010) after years with Eclipse.
Every now and then I've found Eclipse's "Revert" feature pretty useful, that is, to reload the file from disk, discarding all changes. (Nothing to do with version control reverting.)
How can I do this with Visual Studio? Should be pretty simple but I haven't found it yet.
I know that I can do this with "undo until *-indicator disappears" but that's pretty impractical.
Unfortunately I do not know of a built-in way to do this in VS other than closing the file and reopening it without saving.
There might be some extension that does this, but I am not aware of it :(
In the current version, you find in the Explorer, in the left sidebar. Then Open Editors, and right click on the file you want to revert.
If you are using git with Visual Studio:
Solution Explorer > Right Click On File > Git > Undo Changes

ReSharper 5.1 can't navigate to a type from anywhere

I'm running Visual Studio 2010 (10.0.40219.1 SP1Rel) with ReSharper 5.1 (5.1.3000.12). Recently, it seems as though ReSharper has completely lost the ability to navigate to a type.
Here are some actions I can take in the UI that now do nothing:
Right-click on type name in code
editor and select "Go To
Declaration"
Right-click on type name in code
editor and select "Go To
Implementation"
R# "Go to type" (Ctrl-T)
In the R# "Find Results" window, double-clicking a type
Here are some actions that still work:
Double-clicking an item in Solution Explorer
Opening a file from VS Command Window
I've completely uninstalled Visual Studio, then reinstalled it with SP1, and ReSharper 5.1, and I still have the same problem.
I'm assuming there's some kind of configuration open that I've done that is disabling the ability to navigate to a type with ReSharper, I just can't figure out what it is.
Any advice would be much appreciated.
I just experienced this problem. None of the previous suggestions worked for me unfortunately, but I managed to resolve it:
Go to Resharper -> Options
Under Keyboard Shortcuts, temporarily switch to a different scheme than the one selected
Press 'Apply Scheme' button then press Save
hen repeat, but this time select the scheme you actually want and press 'Apply Scheme'
Hopefully that fixes it!
I am using VS 2010 SP1 (same as you)
Delete the Resharper temp files in the same location as your solution file. The folder name will be something like _ReSharper.SomeSolution
Failing that, try one of the R# nightly builds here altho it should work with your current config.

Visual Studio Editor does not underline errors anymore

My Visual Studio (2008) Editor has stopped to underline Errors (this nifty wavy red lines). I can't really tell when, but it can be related to the installation of .Net Framework 3.5 SP 1 or the MVC Beta (which I guess is unlikely). Furthermore have I installed and uninstalled both CodeRush and Resharper for evaluation purposes (decided not to keep either one of them).
Does anyone know the problem and how to restore this functionality again?
Have you checked Tools→Options...→Text Editor→C#→Advanced→Underline errors in the editor?
I usually like to reset my settings after messing around with plugins, as they tend to mess with settings: Tools→Import and Export Settings...→Reset all settings.
About possible causes.
For VS 2012 and 2013 if you have more than one instance of Visual Studio on different machines binded to one "live" account and have installed ReSharper on one of them, it disables the native IntelliSense and error underlines (to replace by it's own rules) that will be synchronised through your account to another machine without ReSharper.
Found it in Visual Studio 2019 as: Tools > Options > Text Editor > General > Show error squiggles
This is generally called Disable Squiggly or Wavy lines in Visual Studio.
How you will do in Visual studio 2013?
TOOLS -> Options... -> Text Editor -> C/C++ -> Advanced -> Disable Squiggles: True/False (Under IntelliSense) -> Press OK
I know its an old question, and with various solutions, but I have fixed it in different way. I'm working with Unity3D on my C# code using VS2017, when suddenly VS decides to stop underlining error while im typing. However, if I close the file tab and reopen, it suddenly undelines the error.
For example:
class A {
public int x;
s;
}
should obvsiouly give an error for that lonely 's' symbol. But, VS doesn't underline it until I close and reopen this file tab.
Solution:
Copied the entire Unity Project folder (which is like a regular VS Solution folder basically) and worked with the new folder, which issue was gone there.
For visual studio 2017 act according to HeeJae's comments in:
https://developercommunity.visualstudio.com/content/problem/113112/design-time-error-checking-isnt-working.html
i.e:
Hi. you are probably hitting a known issue. can you try this?
1.Update to latest release If that doesn’t solve it
2.Go to Tools\Options\Projects and Solutions\General and uncheck “Allow parallel project initialization”.
3.Close VS.
4.Delete the “.vs” directory beside their solution file.
5.Reopen VS.
..
thank you
You can re-enable the "Allow parallel project initialization" option after the issue was solved.
I tried to upgrade VS, reset VS settings, clear VS cache and everything people do conventionally but none of them solved this issue! At the end the mentioned solution worked for me magically.
Good luck
Unloading and loading same project again from the solution does the trick. Just right click on the project and click "Unload Project". Once unloaded, again right click the same project and click "Reload Project". Error highlighting will return.
I had the same issue with 2017. There was a 'disable intelisense' option, make sure that is set to false.
For everyone wondering in 2021..
search for "C_Cpp.errorSquiggles" in the settings.
Make sure to have it active for the user, as well as the workspace.
No need to restart Visual Studio.
For me (VS 2019) , after trying the other answers also, setting the scope of analysis from "Current document" to Open document" brought back the missing error markers
Just go to settings and search for errors and Image in Error Squiggles. You can see the Error squiggles (Modified: Workspace - Right now you can't see it because I modified it). Just click on modified and you will see the disabled option. If by mistake you disabled it, just enable it and you can see the red line errors again in your code.
In latest edition, check for .vscode folder in same project folder. There will be a setting.json file in that. Delete the key value pair of "C_Cpp.errorSquiggles": "Disabled". Restart the vs code.

Resources