Why might VS2019's Go To Implementation be showing duplicate references?

Viewed 80

The behaviour of the Go To Implementation function accessed from the editor context menu or by clicking Ctrl-F12 in Visual Studio has somehow changed in my installation of VS2019.

It used to be that when I used it with the cursor on a method name reference, it would jump directly to the method's implementation unless there were multiple implementations; then it would show them in the Find Symbol Results window.

But something has changed and now it always shows the Find Symbol Results window even if there is only a single implementation. Furthermore, it shows a duplicate of the single implementation or of each if there are more than one. The screenshot shows this where you can see that the same method definition is listed twice with the same Project, File, Line and Column details. enter image description here

Does anyone have any idea why this might be happening? Could it be some incorrectly cached data causing this? Where might such data be cached? I have cleared my temp files, and deleted contents of folders named *cache in any C:\Users\xxxx\AppData\Local\Microsoft\VisualStudio\16.0* folders but this hasn't made a difference.

1 Answers

The duplication can be caused when there are more than one TargetFrameworks e.g.

<TargetFrameworks>net5.0;netstandard2.0</TargetFrameworks>
Related