“Go to Implementation” ending up with “The symbol has no implementations”

佐手、 提交于 2021-02-08 06:46:42

问题


When right clicking on e.g. a method in Visual Studio and selecting Go To Implementation it tells me

The symbol has no implementations

I tried with

services.AddDbContext<RazorPagesMovieContext>(options =>
                options.UseSqlServer(Configuration.GetConnectionString("RazorPagesMovieContext")));

where AddDbContext is actually part of Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions

Is it possible to get Go To Implementation working, as .NET Core and ASP.NET Core are open source? I don't want to manually go to the Github repository for that. Ìf it's not directly possible with Visual Studio, are there maybe any plugins that make this possible?

For the sake of completeness: I am using Visual Studio 2019 Preview and .NET Core Preview 5.


回答1:


You can install the ReSharper plugin for Visual Studio which decompiles source files or the Rider IDE by JetBrains. They are not free however.




回答2:


It's possible to debug the .NET Core code directly through Visual Studio. You need to enable two things in order to achieve that.

  1. Allow symbols to be loaded from Microsoft symbol servers.
  2. Enable debugging for Microsoft' source code.

Both options are available in Visual Studio and no need to use external tools.

In order to allow symbols to be loaded from Microsoft symbol server you need to go to Tools >> Options >> Debugging >> Symbols you will find the symbol servers listed. Put a checkbox to "Microsoft Symbol Servers" like shown in the screen shot below

Then go to Tools >> Options >> Debugging >> General and check the option "Enable .NET Framework for source stepping" This will automatically disable the option "Enable Just My Code" which is fine.

At this point you still won't be able to examine Microsoft code by just selecting the code of interest and pressing F12. However, you can step into Microsoft's code using F11 when debugging your application. This is the way it works.

Note: By enabling Microsoft's symbol servers like shown above will cause your Visual Studio to work way too slow. This is normal because of the many debugging symbols that needs to be downloaded from Microsoft' servers. So use this option only when you want to check something specific and disable it in your daily use.



来源:https://stackoverflow.com/questions/56383941/go-to-implementation-ending-up-with-the-symbol-has-no-implementations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!