roslyn: Find All References doesn't work in a netstandard2.0 / net47 project combination

Version Used: Visual Studio 15.5

Steps to Reproduce: I have a netstandard2.0 library and a net47 project referencing that library

// netstandard2.0 target framework, Microsoft.NET.Sdk
public interface IFoo { void Foo(); }
// net47 target framework, Microsoft.NET.Sdk.Web
interface IBar { void Bar(); }
class FooBar : IFoo, IBar
{
    public void Foo() { }
    public void Bar() { }
}

Now run Find All References on both Foo and Bar methods (or look at CodeLense)

Expected Behavior:

Both Foo() and Bar() should show references back and forth.

Actual Behavior:

Only Bar() from within the net47 project itself has a reference: image

When I change the netstandard2.0 library to net47, the reference for Foo() shows up as expected

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 15
  • Comments: 21 (5 by maintainers)

Most upvoted comments

@mrmoses Update to at least Visual Studio 15.7.1. Seems to be working fine now.

The problem is still there in version 15.9.5. My situation is a little different though. My interface is in the .NET Standard 2.0 class library project, and the implementation is in .NET Core 2.1 project. The .NET Core project has reference to the class library. I can’t do a “go to implementation” from any usage of the method in the interface, nor can I do that directly from the interface itself. Very annoying indeed!

I get this problem too on 15.9.2 and earlier. very annoying!