本文介绍了在ASP.NET Core RTM Web API中使用Glimpse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ASP.NET Core Web API,并且已经安装了Glimpse的beta2版本进行概要分析.我能够在Startup.cs中执行 services.AddGlimpse app.UseGlimpse ,但是在触发API端点时,浏览器中未显示Glimpse HUD.

关于如何解决此问题的任何建议?

解决方案

瞥见式HUB需要将自身注入HTML.结果:HUB无法将其自身注入返回纯文本或JSON的API端点.相反,我们必须使用完整的Glimpse客户端.这是怎么回事.

转到

这将在新选项卡中打开完整的Glimpse Client.

现在,返回到原始标签并导航至API路由(例如/api/products).

再次返回完整的Glimpse Client,以查看对该请求的分析.

请参阅: https://github.com/Glimpse/Glimpse.Prototype/issues/132

I am using ASP.NET Core Web API, and I have installed the beta2 version of Glimpse for profiling. I was able to do services.AddGlimpse and app.UseGlimpse in Startup.cs, but Glimpse HUD is not showing up in the Browser when I am firing the API end points.

Any suggestions on how to fix this issue?

解决方案

The Glimpse HUB requires HTML into which to inject itself. Result: the HUB cannot inject itself into an API endpoint that returns plain text or JSON. Instead, we have to use the full Glimpse client. Here is how.

Go to http://localhost:5000 (or to any page that renders the HUB) and click on the "g" link.

That will open the full Glimpse Client in a new tab.

Now, return to your original tab and navigate to an API route (e.g. /api/products).

Return again to the full Glimpse Client to see the analysis of that request.

See: https://github.com/Glimpse/Glimpse.Prototype/issues/132

这篇关于在ASP.NET Core RTM Web API中使用Glimpse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-03 20:38