获取“找不到资源。 ”尝试加载 Glimpse 时出错
我有一个现有的 MVC3 项目(大约 3 个月前从 MVC2 升级),然后昨天通过 NuGet 添加了 Glimpse。当我运行(按 F5)它时,然后转到 http://localhost:8888/Glimpse/Config 我得到的是“'/'应用程序中的服务器错误”错误 - 找不到资源。
我尝试创建一个全新的 MVC3 项目并通过 NuGet 添加 Glimpse,它可以工作。我的 global.asax 逐行完全相同,我的 web.config 也是如此。
根据 ELMAH 的说法,Glimpse 的 dll 已找到并正确执行,但由于它不是从 IController 继承,因此它会崩溃。以下是 ELMAH 的屏幕截图:
有任何提示吗?
I have an existing MVC3 project (upgraded from MVC2 about 3 months ago) and then added Glimpse via NuGet yesterday. When I ran (hit F5) it, and go to http://localhost:8888/Glimpse/Config what I got is error for "Server Error in '/' Application" - The resource cannot be found.
I have tried creating a brand new MVC3 project and adding Glimpse via NuGet in there and it works. My global.asax is exactly the same line by line and so is my web.config.
According to ELMAH, the dll for Glimpse is found and executed properly, but since it's not inheriting from IController so it breaks. Here is a screen shot from ELMAH:
Any hints?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我们有一个 HttpModule 来监听请求,Glimpse/?如果 HttpModule 已加载,那么它应该在 MVC 尝试将“Glimpse”解析为控制器之前很久就处理请求。
如果您收到错误消息,那么您的配置似乎可能有问题。您能否将示例项目中适用的配置与实际项目中的配置进行比较,以确保所有注册都已完成。
如果一切看起来都很好,那么接下来的事情就是配置正确,但 HttpModule 没有被注册。要进行注册,我们正在使用:
请参阅 http://odetocode。 com/blogs/scott/archive/2011/02/27/dynamicmoduleutility.aspx 了解更多信息。
鉴于您升级了解决方案,我想说也许它在这里。但可以肯定的是,如果您无法找到它,您是否可以向我们发送具有相同问题的解决方案的简化版本?
最后,你有没有做一些“不合常理”的事情?具体是使用不同的视图引擎或自定义依赖解析器等?
We have a HttpModule that listens for requests that are Glimpse/? If the HttpModule is loaded then it should handle the request long before MVC tries to resolve "Glimpse" as a controller.
If you are getting the error you are it would seem that maybe something is wrong with your config. Can you compare your config in your sample project that works to the real project that doesn't to make sure all the registrations have come across.
If everything looks fine there, the next thing is that the config is right but the HttpModule is not being registered. To do the registration we are using:
See http://odetocode.com/blogs/scott/archive/2011/02/27/dynamicmoduleutility.aspx for more.
Given that you upgraded your solution I would say maybe its something here. To be sure though, if you aren't able to track it down, any chance that you can send us a cut down version of your solution that has the same problem?
Lastly, are you doing anything "out of the norm"? Specifically are using a different view engine, or custom dependency resolver, etc?
我也遇到了这个问题,事实证明我的问题是我删除了 Castle.Core 和 Castle.DynamicProxy 引用。我
随后
执行了“从包管理器控制台”,它自行排序。
I had this issue also, turns out my problem was that I had removed the Castle.Core and Castle.DynamicProxy references. I did an
followed by
From the package manager console and it sorted itself.
从版本 0.83 开始,Glimpse 不再使用 config/config(或任何glimpse/*)URL。
相反,请转至 Glimpse.axd 更改您的 Glimpse 设置。
As of version 0.83, Glimpse no longer uses the config/config (or any glimpse/*) URL.
Instead, please go to Glimpse.axd to change your Glimpse settings.