“执行"最终以“符号没有实现"结束. [英] "Go to Implementation" ending up with "The symbol has no implementations"

查看:40
本文介绍了“执行"最终以“符号没有实现"结束.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

右键单击例如Visual Studio中的方法,然后选择转到实现告诉我

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

该符号没有实现

我尝试过

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

其中AddDbContext实际上是 Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions

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

.NET Core和ASP.NET Core是开源的,是否有可能使 Go To Implementation 工作?我不想为此手动转到Github存储库.Ì如果Visual Studio无法直接实现,是否有任何插件可以实现这一目标?

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?

出于完整性考虑:我正在使用Visual Studio 2019预览版和.NET Core预览版5.

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

推荐答案

可以直接通过Visual Studio调试.NET Core代码.您需要启用两件事才能实现这一目标.

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. 允许从Microsoft符号服务器中加载符号.
  2. 启用Microsoft源代码的调试.

这两个选项在Visual Studio中都可用,不需要使用外部工具.

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

为了允许从Microsoft符号服务器加载符号,您需要转到工具>>选项>>调试>>符号,您将找到列出的符号服务器.如下图所示,在"Microsoft Symbol Servers" 中放置一个复选框

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

然后转到工具>>选项>>调试>>常规,并选中选项启用用于源代码步进的.NET Framework" ,这将自动禁用选项启用我的代码" .

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.

在这一点上,您仍然无法仅通过选择所需的代码并按 F12 来检查Microsoft代码.但是,在调试应用程序时,可以使用 F11 进入Microsoft的代码.这就是它的工作方式.

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.

注意:如上所示,通过启用Microsoft的符号服务器将导致Visual Studio的运行速度过慢.这是正常现象,因为需要从Microsoft的服务器上下载许多调试符号.因此,仅当您要检查特定的东西并在日常使用中将其禁用时才使用此选项.

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.

这篇关于“执行"最终以“符号没有实现"结束.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆