当我的大ASP.NET站点进行更新,IIS必须重新编译不少呢。有没有一种方法,以减少我的编译时显著?我的、显著、站点、方法

2023-09-03 07:32:33 作者:一次不忠,终身不用

DotNetNuke的是一个大的ASP.NET CMS其中大部分是$ P $对 - 编译,作为最内包含的模块。

DotNetNuke is a large ASP.NET CMS which is mostly pre-compiled, as are most of the modules contained within.

当我们部署我们的DotNetNuke网站的变化,我们必须重新编译后的第一页命中出现的两位。

When we deploy our DotNetNuke site changes, we have two bits of recompilation that occur upon the first page hit.

当一个DLL被替换bin文件夹中出现在应用程序级重新编译 单个模块访问首次每次,一些重编译发生该特定模块。 Application-level recompilation that occurs when a DLL is replaced in the bin folder Each time an individual module is accessed for the first time, some recompiling occurs on that specific module.

有没有办法来分配更多的CPU的能力,以编制asp.net网站在IIS 7?

我想使用多个内核,或者至少做些什么来减少重新编译的时间。

Q&放大器; A

您应该使用pre-编译ASP.NET。你为什么不?

You should use pre-compiled ASP.NET. Why aren't you?

我们使用的是pre-编译ASP.NET。仅仅因为一个ASP.NET应用程序被编译成一个DLL并不意味着ASP.NET运行时不会做额外的重新编译,以服务其vistiors。

你怎么知道它重新编译,而不是填充缓存什么的?

How do you know it's recompiling and not populating the cache or something?

在服务器上查看任务管理器显示在上述页面点击率50%的CPU使用率由编译器可执行文件。为什么50%? 2核服务器。

推荐答案

设置<编译optimizeCompilations =真/>

指定动态编译是否将重新编译整个网站,如果顶层文件被更改。顶层文件包括在Global.asax文件和斌APP_ code文件夹中的所有文件。如果真,只更改的文件重新编译。

Specifies whether dynamic compilation will recompile an entire site if a top-level file is changed. Top-level files include the Global.asax file and all files in the Bin and App_Code folders. If True, only changed files are recompiled.

来源:编译元素(ASP.NET设置架构)

有关利弊的更多信息,找到理解ASP.NET动态编译,在优化动态编译。错误的主要原因是去除或改变现有方法的签名,从而导致已编译的页面抛出的MissingMethodException直到它们被重新编译。

More information about the pros and cons can be found at Understanding ASP.NET Dynamic Compilation, under Optimizing Dynamic Compilation. The primary cause of errors are removal or changes in existing method signatures, causing already compiled pages to throw a MissingMethodException until they are recompiled.

您也可以考虑减少批量大小批量编辑,或完全禁用它。我相信,这将缩短编译时间用于单页,但产生更多的组件和消耗更多的内存。

You could also look into reducing the batch size for batch compilation, or disable it completely. I believe this will reduce compilation times for single pages, but generate more assemblies and consume more memory.