调试时如何加速和优化asp.net站点的编译器构建 [英] how to speed up and optimize compiler build of asp.net site when debugging

查看:20
本文介绍了调试时如何加速和优化asp.net站点的编译器构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio 2008/2010/ASP.NET:

Visual Studio 2008/2010/ASP.NET:

如何加快解决方案重建后的延迟?

How to speed up the delay after rebuilding the solution?

我喜欢在测试我的更改或调试问题时分离我的调试器,这些问题可以通过简单的跟踪跟踪来查明.

I like to detach my debugger while testing my changes or debugging issues that can be pinpointed by a simple strack trace.

修复错误后,我构建解决方案,然后刷新页面.

After I fix a bug, I build the solution and then refresh the page.

在网页显示之前,在重建之后会出现初始延迟时间.

There's that initial lag time that occurs after the rebuild before the web page displays.

在那之后,它应该尽可能快.我听说应用程序在这段时间内正在加载所有新的 DLL.

After that, it's as fast as it should be. I heard that the application is loading up all the new DLLs during this time.

有什么办法可以减少这种滞后量吗?

Is there any way to reduce the amount of this lag?

推荐答案

您可以将optimizeCompilations设置为true,将batch设置为false

You can set the optimizeCompilations to true, and batch to false

<compilation batch="false" optimizeCompilations="true" ... >

batch=false 告诉 asp.net 在必要时只构建您调用的页面.我们将批处理设置为 true,仅在发布实时站点时,因此 asp.net 会在一个页面编译许多页面,您可能会有很大的延迟,但只有一个...

batch=false says to asp.net to build if necessary only the page that you call. We set batch to true, only on release live site to so the asp.net compiles many pages at ones, and you may have a big delay but only ones...

optimizeCompilations=true 表示每个页面在每次运行时都不会检查库更新.这有一个小问题——如果你改变一个全局静态函数,例如从 4 个页面调用,这 4 个页面不知道这个函数发生了变化,所以你只需要打开它们并保存它们,强制编译器重新——编译它们.否则他们会抛出错误,因为他们没有检查是否有变化 - 您必须知道并更新它们以强制重新编译.

The optimizeCompilations=true says that each page is not check for libraries updates each time its runs. This have a minor issue - if you change a global static function for example that is called from 4 pages, this 4 pages did not know that this function change, so you need to just open them and saved them, to force compiler to re-compile them. Or else they throw error because they did not check if something change - you must know that and updates them to force the re-compile.

参考:编译部分班级

这篇关于调试时如何加速和优化asp.net站点的编译器构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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