我正在尝试使用我的 asp.net mvc 3 应用程序配置 mvc miniprofiler。问题是我无法在我的视图中访问 MiniProfiler 类(我正在使用 webforms 视图引擎)。我尝试了几件事
- 在 web.config (main web.config) 中的 page 指令下添加了命名空间
- 在 web.config 中的 page 指令下添加了命名空间(视图文件夹中的 web.config)
- 在视图中导入命名空间
但是当我写
<%var profiler = MiniProfiler.Current;%>
在我看来,它宣布 MiniProfiler 在当前上下文中不存在。