[英]Why can't I edit my ASP.NET Web application at run time?
Why are the code-behind pages for an ASP.NET web application locked at run time? 为什么ASP.NET Web应用程序的代码隐藏页面在运行时被锁定? I have older projects (probably defined as "web sites" instead of "web apps") where I can edit the code behind, refresh the browser, and see my changes.
我有较旧的项目(可能定义为“网站”而不是“网络应用程序”),我可以编辑后面的代码,刷新浏览器,看看我的更改。 With the web app, I have to continually close and reopen the browser if I want to see my changes live.
使用Web应用程序,如果我想要查看我的更改,我必须不断关闭并重新打开浏览器。 Is there a setting or something I'm missing to allow me to edit at run time, and without restarting the debugging session?
是否有一个设置或我缺少的东西允许我在运行时编辑,而不重新启动调试会话?
You can enable Edit and Continue in the project properties. 您可以在项目属性中启用“编辑”和“继续”。 Right click the project in the solution explorer, select the Web tab and check Enable Edit and Continue.
右键单击解决方案资源管理器中的项目,选择“Web”选项卡,然后选中“启用编辑并继续”。
Now you can edit your sources, but you have to pause the debugger to do so. 现在您可以编辑源代码,但必须暂停调试器才能执行此操作。
When using IIS as your development server, Edit and continue is not currently available for Visual Studio for ASP.NET. 使用IIS作为开发服务器时,Visual Studio for ASP.NET目前无法使用“编辑并继续”。
See this blog entry , however, that shows it is possible for the Visual Studio 2005 Web Application Project Project type. 但是,请参阅此博客条目 ,该条目显示可以使用Visual Studio 2005 Web应用程序项目项目类型。 It requires using the Visual Studio Development Server (Cassini) during development instead of your local IIS (see the properties box on the project).
它需要在开发期间使用Visual Studio开发服务器(Cassini)而不是本地IIS(请参阅项目中的属性框)。
No, in web applications, the codebehinds are pre-compiled into dlls, so any change in the dlls will recycle the App pool, and stop your debugging session, 不,在Web应用程序中,代码隐藏被预编译到dll中,因此dll中的任何更改都将回收App池,并停止调试会话,
If you press ctrl-F5 instead of just F5 to start (or host you site in IIS), you start without the debugger, and don't need to restart the browser all the time... 如果您按ctrl-F5而不是仅按F5启动(或在IIS中托管您的站点),则在没有调试器的情况下启动,并且不需要一直重启浏览器...
Unless you really really need to debug a problem you can't figure out, You should start the web app without debugger, makes it snappier to start up. 除非你真的 很需要调试你不能弄清楚一个问题,你应该开始的Web应用程序而无需调试,使得它迅捷启动。 Every minute spent debugging is a minute not spent writing a unit test.
花在调试上的每一分钟都花在一分钟而不是花在单独测试上。 IMHO you should write unit tests, they last longer.
恕我直言,你应该写单元测试,他们持续时间更长。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.