的Visual Studio 2013 - 调试MVC code。与ViewBag性能死一般缓慢,无法使用 [英] Visual Studio 2013 - Debugging MVC code with ViewBag properties deathly slow and unusable

查看:249
本文介绍了的Visual Studio 2013 - 调试MVC code。与ViewBag性能死一般缓慢,无法使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想出来的最新的Visual Studio,但在调试与ViewBag动态变量最基本的MVC应用程序给了我很多头痛。

I'm trying out the latest Visual Studio, but debugging the most elementary MVC application with ViewBag dynamic variables gives me a lot of headache.

我在运行Visual Studio 2013在32位的Windows 8操作系统,全新的安装和应用所有可用的更新。

I'm running Visual Studio 2013 under 32-bit Windows 8 operating system with clean install and every available update applied.

我创建新的ASP.NET Web应用程序(.NET框架4.5 - 新的解决方案)与之后我加入样品Home控制器的一些元素code文件夹和核心引用了MVC:

I created new ASP.NET Web Application (.NET Framework 4.5 - New Solution) with folders and core references for MVC after which I added sample Home controller with some element code:

dynamic d1 = 1;
dynamic d2 = 2;

ViewData["Vd1"] = 1;
ViewData["Vd2"] = 2;

ViewBag.Vb1 = 1;
ViewBag.Vb2 = 2;

在第一行击中断点和步进到第二个,直到ViewBag物业工作的罚款(瞬间) - 那么,在输出窗口我:

Hitting breakpoint at the first line and stepping to the second until the ViewBag property worked fine (instantly) - then, in the Output window I got:

类型'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException的第一次机会异常出现在Microsoft.CSharp.dll

A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll

...并迈向第二行(ViewBag.Vb2 ...)花了几秒钟。我测试了不同的动态变量,以确保该问题与ViewBag属性。

...and stepping to the second line (ViewBag.Vb2...) took couple of seconds. I tested different dynamic variables to make sure the problems are with ViewBag properties.

什么原因导致在IIS下防爆preSS异常等慢调试?广泛使用ViewBag特性使得调试一场噩梦!

What causes the exception and so slow debugging under IIS Express? Extensive use of ViewBag properties makes debugging a nightmare!

再次调用调试下的脚本不会导致异常和调试工作得很好,因为调试符号都被加载(猜测)。

Calling again the script under Debug don't cause the exceptions, and debug works fine because the Debugging Symbols are all loaded (guessing).

我试过很多不同的意见可以在堆栈溢出和其他过网,但它不工作!

I tried lots of different suggestions available at Stack Overflow and else over the net, but non of it works!

推荐答案

其中忽视了,从来没有报道提高调试速度为Visual Studio问题2013 ASP .NET应用程序(MVC和web表单)是禁用浏览器链接。这是2013 VS一项新功能,这会导致巨额的开销,并导致页面极为缓慢加载(5-10秒,在大多数情况下,我的)。禁用它把它带回到Visual Studio 2012的速度。

One of the overlooked and never reported issues on increasing debug speed for visual studio 2013 ASP .NET apps (MVC and webforms) is to disable browser link. This is a new feature in VS 2013 which causes a huge amount of overhead and causes pages to load extremely slowly (5-10 seconds in most of my cases). Disabling it brings it back to Visual Studio 2012 speeds.

在这里看到如何禁用它:

See here for how to disable it:

<一个href=\"http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-feature-in-visual-studio-$p$pview-2013.aspx\" rel=\"nofollow\">http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-feature-in-visual-studio-$p$pview-2013.aspx

这篇关于的Visual Studio 2013 - 调试MVC code。与ViewBag性能死一般缓慢,无法使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆