MvcMiniProfiler 1.9 - VS 或运行时无法识别步骤方法
我刚刚在 VS 2010 中通过 NuGet 安装了 MvcMiniprofiler。
我能够启动探查器并且其工作顺利。问题是我想在“Step”方法中包装一段代码。我按照示例操作并使用 using
语法。
例如,
using(profiler.Step("A"))
{
// some code to be profiled
}
问题在于,asp.net 编译器和 Visual Studio 都无法识别 Step
方法是什么,并且在运行时给我一个 YSOD 说法。
编译器错误消息:CS1061:“MvcMiniProfiler.MiniProfiler”不包含“Step”的定义,并且找不到接受“MvcMiniProfiler.MiniProfiler”类型的第一个参数的扩展方法“Step”
其他一切都工作正常。
Step 方法是否已被其他方法取代?
I just installed MvcMiniprofiler via NuGet in VS 2010.
I am able to start the profiler and its working smoothly. The problem is that i want to wrap a piece of code in the "Step" method. I followed the example and am using the using
syntax.
e.g.
using(profiler.Step("A"))
{
// some code to be profiled
}
The problem is that neither the asp.net compiler nor visual studio is recognizing what the Step
method is and at run-time gives me a YSOD saying.
Compiler Error Message: CS1061: 'MvcMiniProfiler.MiniProfiler' does not contain a definition for 'Step' and no extension method 'Step' accepting a first argument of type 'MvcMiniProfiler.MiniProfiler' could be found
Everything else is working fine.
Has the Step method been replaced by something else ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
'
.Step
是一种扩展方法 - 它是这样设计的,因此当分析关闭时,它对性能的影响接近于 0。您需要将其放在文件的顶部。
使用 StackExchange.Profiling;
'
.Step
is an extension method - it is designed this way so it has close to 0 performance impact when profiling is off.You will need this at the top of your file.
using StackExchange.Profiling;