相关疑难解决方法(0)

使用MiniProfiler和MVC 5

编辑这里得到答案

所以我想查看MiniProfiler来解决一些性能问题.在将其用于生产代码之前,我想尝试使用样本,然后继续创建MVC 5应用程序.这是使用模板创建的普通香草应用程序.

在HomeController的Index()方法中添加了此代码:

var profiler = MiniProfiler.Current;
        using (profiler.Step("Set page title"))
        {
            ViewBag.Title = "Home Page";
        }
        using (profiler.Step("Doing complex stuff"))
        {
            using (profiler.Step("Step A"))
            { // something more interesting here
                Thread.Sleep(100);
            }
            using (profiler.Step("Step B"))
            { // and here
                Thread.Sleep(250);
            }
        }
        return View();
Run Code Online (Sandbox Code Playgroud)

在_Layout中的jquery包下面添加了这一行:

@Scripts.Render("~/bundles/jquery")
@StackExchange.Profiling.MiniProfiler.RenderIncludes()

@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
Run Code Online (Sandbox Code Playgroud)

跑了应用程序.什么都没有出现.没有剖析,没有.

我错过了什么?

问候.

asp.net-mvc mvc-mini-profiler

15
推荐指数
2
解决办法
5544
查看次数

标签 统计

asp.net-mvc ×1

mvc-mini-profiler ×1