Sto*_*orm 5 asp.net-mvc-3 mvc-mini-profiler
我刚刚在VS 2010中通过NuGet安装了MvcMiniprofiler.
我能够启动分析器并使其顺利工作.问题是我想在"Step"方法中包装一段代码.我按照示例使用了using
语法.
例如
using(profiler.Step("A"))
{
// some code to be profiled
}
Run Code Online (Sandbox Code Playgroud)
问题是asp.net编译器和visual studio都没有识别出Step
方法是什么,并且在运行时给我一个YSOD的说法.
编译器错误消息:CS1061:'MvcMiniProfiler.MiniProfiler'不包含'Step'的定义,并且没有扩展方法'Step'接受类型为'MvcMiniProfiler.MiniProfiler'的第一个参数'
其他一切都很好.
Step方法是否已被其他东西取代?
' .Step
是一种扩展方法 - 它是以这种方式设计的,因此在关闭分析时它会产生接近0的性能影响.
您将需要在文件顶部.
using StackExchange.Profiling;