将所有视图放在共享文件夹中 - 可以工作,但会引发“捕获的异常”。性能问题?
我有一个简单但频繁使用的应用程序,是在 VS2010/MVC2 中完成的。我不喜欢为每个视图/控制器设置单独的文件夹,因此将所有视图都放在共享文件夹中。它工作正常,但在 VS 中调试时,我注意到它抛出 IO“捕获异常”,因为它似乎在进入共享文件夹之前先在 [FolderName]/[ViewName] 文件夹中查找。
同样,该应用程序运行良好,但我担心所有这些“捕获的异常”都会对性能产生较小的影响,因为它们确实通过 CLR 产生了成本。有什么方法可以配置路由,使其仅在共享文件夹中查找?
谢谢。
I have a simple but heavily used app done in VS2010/MVC2. I didn't like having separate folders for each view/controller and so have all the views in the Shared folder. It's working fine but while debugging in VS, I noticed that it's throwing IO "caught exceptions" since it seems to be looking in the [FolderName]/[ViewName] folder before going down to the Shared folder.
Again, the app runs fine but I'm concerned that all these "caught exceptions" will have a minor performance impact since they do have a cost in via the CLR. Is there any way I can configure the Routing so that it will only look in the Shared folder?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在调试模式下是的,在发布模式下视图位置会被缓存,因此不必担心性能,除非您在调试模式下发布站点。查看这篇文章。
In Debug mode yes, in Release mode view locations are cached, so don't worry about performance unless you are shipping your site in Debug mode. Check out this post.