MVC-Mini-Profiler 错误:yepnope 未定义

发布于 2024-11-17 01:11:20 字数 798 浏览 5 评论 0原文

我正在使用 mvc-mini-profiler 来分析我的 MVC 站点。它在我的本地计算机上运行良好,但是当我发布到托管服务器时,探查器不会加载,并且出现以下错误:

yepnope is not defined
yepnope([ 

据我所知,问题在于探查器尝试在 yepnope 之前使用 yepnope已加载。有没有办法解决这个问题,也许可以在执行 miniprofile 渲染命令之前强制检查 yepnope 是否已加载?以下是页面生成源中的相关行为

<script type="text/javascript" src="/mini-profiler-yepnope.1.0.1.js"></script>
<script type="text/javascript">
yepnope([
{ test: window.jQuery, nope: '/mini-profiler-jquery.1.6.1.js' }, 

了完整起见,我的 _layout 文件中的调用

<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js" type="text/javascript"></script>
@MiniProfiler.RenderIncludes(position: RenderPosition.Left, showTrivial: false, showTimeWithChildren: false)

I am using the mvc-mini-profiler to profile my MVC site. It runs fine on my local machine, but when i publish to my hosting server, the profiler doesn't load, and i get the following error:

yepnope is not defined
yepnope([ 

As far as I can tell, the problem lies in the profiler trying to use yepnope before yepnope has been loaded. Is there a way around this, maybe by forcing a check to see if yepnope has been loaded before executing the miniprofile render command? Here are the relevant lines from the page's generated source

<script type="text/javascript" src="/mini-profiler-yepnope.1.0.1.js"></script>
<script type="text/javascript">
yepnope([
{ test: window.jQuery, nope: '/mini-profiler-jquery.1.6.1.js' }, 

And for completeness, the calls in my _layout file

<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js" type="text/javascript"></script>
@MiniProfiler.RenderIncludes(position: RenderPosition.Left, showTrivial: false, showTimeWithChildren: false)

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

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

发布评论

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

评论(3

不必在意 2024-11-24 01:11:20

检查尝试加载 yepnope.js 时是否收到 404 错误。 MvcProfiler 在处理应用程序路径时存在错误,该错误已得到解决
在以后的构建中。

MVC Mini Profiler 不尊重应用程序的路径

Check if you are getting a 404 error when trying to load yepnope.js. There was a bug in MvcProfiler in dealing with application path, which has been addressed
in later builds.

MVC Mini Profiler includes not respecting application's path

颜漓半夏 2024-11-24 01:11:20

确保在为站点注册路由时没有清除路由。迷你探查器可能会在站点初始化之前将这些 javascript 文件的自己的路由添加到 RouteCollection 中。

Make sure that you aren't clearing your routes when registering them for your site. The mini profiler adds its own routes for those javascript files to the RouteCollection potentially before your site is initialized.

自演自醉 2024-11-24 01:11:20

如果其他人遇到这个问题,它已提交到他们的谷歌代码项目。这是一个已知问题,他们正在努力解决。

如果您想跟踪问题页面

In case anyone else has this problem, it has been submitted to their google code project. It is a known issue, and they are working on it.

Issue Page if you want to track it

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