仅Visual Studio 2022-瞥见错误; “运行时策略不允许执行名为glimpse_config;。”的资源执行。

发布于 2025-02-10 04:41:54 字数 990 浏览 1 评论 0原文

当我调试项目时(在VS 2022中)时,使用URL:“ https:// localhost:44329/glimpse.axd”,我在浏览器窗口中收到以下错误。 “运行时策略不允许执行名为'glimpse_config'的资源。”

此错误仅在使用Visual Studio 2022 Professional时才发生。在运行相同的代码时,在Visual Studio 2019 Professional中相同的存储库时,Lims运行良好,我可以访问它,如下所述: https://learn.microsoft.com/en-us/aspnet/mvc/overview/performance/profile-and-debug-and-debug-your-aspnet-mvc-app-app-with-with-glimpse

我已经回顾了我的两个视觉工作室之间的选项设置,没有运气。 我想念什么?

注意:我的web.config文件已经在此处提到了代码: runtime policy不允许执行名为名称nation nation'的资源' Glimpse_config'

无论好坏,我都提出了一个单独的问题,并且没有将其纳入上述问题,因为这似乎与我的Visual Studio 2022设置有关。

When I debug my project (in VS 2022), using URL: "https://localhost:44329/glimpse.axd" I get the following error in the browser window.
"Runtime policy does not allow execution of resource named 'glimpse_config'."

This error only happens when using Visual Studio 2022 Professional. When running the same code, same repository in Visual Studio 2019 Professional, Glimpse runs fine and I can access it, as mentioned in:
https://learn.microsoft.com/en-us/aspnet/mvc/overview/performance/profile-and-debug-your-aspnet-mvc-app-with-glimpse

I've reviewed the option settings between my two Visual Studios and no luck.
What am I missing?

Note: My web.config file already has code mentioned here:
Runtime policy does not allow execution of resource named 'glimpse_config'

For better or worse, I made this a separate question and didn't tac it onto the above question because this seems to pertain to my Visual Studio 2022 setup.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江心雾 2025-02-17 04:41:54

我弄清楚了这个问题。

我继承的这个代码中有这种瞥见的类和方法:

    public class GlimpseSecurityPolicy:IRuntimePolicy
{
    public RuntimePolicy Execute(IRuntimePolicyContext policyContext)
    {
       stuff...
    }

    public RuntimeEvent ExecuteOn
    {
       stuff...
    }
}

我只是评论了整个课程,这使您能够在Visual Studio 2022中工作。
有趣的是,这并没有在2019年Visual Studio中引起问题。

I figured the problem out.

This code that I inherited, had this Glimpse class and methods in it:

    public class GlimpseSecurityPolicy:IRuntimePolicy
{
    public RuntimePolicy Execute(IRuntimePolicyContext policyContext)
    {
       stuff...
    }

    public RuntimeEvent ExecuteOn
    {
       stuff...
    }
}

I just commented out this entire class and that has allowed Glimpse to work in Visual Studio 2022.
Interestingly enough, this was NOT causing an issue in Visual Studio 2019.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文