且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在ASP.NET Core RTM Web API中使用Glimpse

更新时间:2023-02-15 22:11:36

瞥见式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