compilation 元素(ASP.NET 设置架构)
配置 ASP.NET 用于编译应用程序的所有编译设置。
<configuration> 元素
system.web 元素(ASP.NET 设置架构)
compilation 元素(ASP.NET 设置架构)
<compilation
debug="[true|false]"
batch="[true|false]"
batchTimeout="number of seconds"
defaultLanguage="language"
explicit="[true|false]"
maxBatchSize="maximim number of pages"
maxBatchGeneratedFileSize="maximum combined size"
numRecompilesBeforeAppRestart="number"
strict="[true|false]"
tempDirectory="temporary files directory"
urlLinePragmas="[true|false]"
assemblyPostProcessorType="assembly post processor, assembly"
>
<assemblies>...</assemblies>
<buildproviders>...</buildproviders>
<codeSubDirectories>...</codeSubDirectories>
<compilers>...</compilers>
<expressionBuilders>...</expressionBuilders>
</compilation>
属性
| 属性 | 说明 |
|---|---|
|
assemblyPostProcessorType |
可选的 String 属性。 通过引用程序集的处理器后功能为程序集指定后续处理编译步骤。使用"assembly post processor,assembly" 格式。assembly post processor 必须实现 IAssemblyPostProcessor 接口。使用这种后续处理方法可以针对编译强制执行调试,这可以在指定部署模式时重写。 此属性是 .NET Framework 2.0 版中的新属性。 默认值为空字符串。 |
|
batch |
可选的 Boolean 属性。 指示是否支持批处理。 如果为 True,则清除在第一次访问文件时所需的编译导致的延迟。当该属性设置为 True 时,ASP.NET 将以批处理模式预编译所有未编译的文件,第一次编译文件时,这将导致更长时间的延迟。但在这一初始延迟之后,对文件进行后续访问时,将消除编译延迟。 默认值为 True。 |
|
batchTimeout |
可选的 TimeSpan 属性。 指定批编译的超时期限(以秒为单位)。如果编译不能在超时期限内完成,则编译器还原为当前页的单编译模式。 默认值为“900”(15 分钟)。 |
|
debug |
可选的 Boolean 属性。 指定是否应编译调试二进制文件(而非发布的二进制文件)。 默认值为 False。 |
|
defaultLanguage |
可选的 String 属性。 指定要在动态编译文件中使用的默认编程语言,如 "C#" 或“PERL”。语言名是使用 system.codeDom 节的 compilers 元素或此元素的 compilers子元素(已被否决)定义的。 默认值为 "vb"。 |
|
explicit |
可选的 Boolean 属性。 指定是否设置 Microsoft Visual Basic explicit 编译选项。如果为True,则必须使用 Dim、Private、Public 或 ReDim 语句声明所有变量。 默认值为 True。 |
|
maxBatchGeneratedFileSize |
可选的 Int32 属性。 指定每个批编译过程中生成的源文件的最大组合大小(以 KB 为单位)。通常情况下,当实际需要的位数很少却在内存中加载巨大的程序集并不是理想的做法。该限制有助于确保程序集的大小控制在合理的范围内,使应用程序能够利用批处理机制而又不会使系统过载。这类似于maxBatchSize。 默认值为 1000。 |
|
maxBatchSize |
可选的 Int32 属性。 指定每个成批处理的编译的最多页数。 默认值为 1000。 |
|
numRecompilesBeforeAppRestart |
可选的 Int32 属性。 指定应用程序重新启动前可能对资源进行动态重新编译的次数。在全局和应用程序级别(而非目录级别)支持该属性。 默认值为 15。 |
|
strict |
可选的 Boolean 属性。 指定是否启用 Visual Basic strict 编译选项。 默认值为 False。 |
|
tempDirectory |
可选的 String 属性。 指定编译期间用于临时文件存储的目录。 默认值为空字符串。若为空字符串并且目前的进程标识具有所需的权限访问目录,则文件将存储在 %FrameworkInstallLocation%\Temporary ASP.NET Files 下。否则,系统将抛出或移动至其他位置。例如,可以在用户配置文件下创建临时目录。 |
|
urlLinePragmas |
可选的 Boolean 属性。 指定编译器是否应使用 URL(而非物理路径)。 默认值为 False。 |
子元素
| 元素 | 说明 | ||
|---|---|---|---|
|
assemblies |
定义一个程序集名称的集合,这些程序集在 ASP.NET 资源编译期间使用。 |
||
|
buildproviders |
定义用于编译自定义资源文件的生成提供程序的集合。 此元素是 .NET Framework 2.0 版中的新元素。 |
||
|
codeSubDirectories |
定义一个有序子目录集合,这些子目录包含在运行时编译的文件。 此元素是 .NET Framework 2.0 版中的新元素。 |
||
|
compilers |
定义一个编译器选项的集合。
|
||
|
expressionBuilders |
定义一个要在编译期间使用的资源字符串的集合。资源字符串将前缀与表达式生成器关联起来。 此元素是 .NET Framework 2.0 版中的新元素。 |
父元素
| 元素 | 说明 |
|---|---|
|
configuration |
指定公共语言运行库和 .NET Framework 应用程序所使用的每个配置文件中均需要的根元素。 |
|
system.web |
在配置文件中指定 ASP.NET 配置设置的根元素,它包含配置 ASP.NET Web 应用程序行为的配置元素。 |
在 .NET Framework 2.0 版中,compilation 元素的 compilers 子元素已被否决,而改为使用 system.codeDom 节的 compilers 元素。但是,使用 compilation 元素的 compilers 子元素仍然有效,并且将重写位于system.codedom 节中的 compilers 元素。
<compilation
tempDirectory=""
debug="false"
strict="false"
explicit="true"
batch="true"
batchTimeout="900"
maxBatchSize="1000"
maxBatchGeneratedFileSize="1000"
numRecompilesBeforeAppRestart="15"
defaultLanguage="vb"
urlLinePragmas="false"
assemblyPostProcessorType=""
>
<assemblies>
<clear />
</assemblies>
<buildProviders>
<clear />
</buildProviders>
<expressionBuilders>
<clear />
</expressionBuilders>
</compilation>
下面的默认 compilation 元素在 .NET Framework 1.1 版的 Machine.config 文件中配置。在 .NET Framework 1.0 版中也存在类似的设置,但版本号不同。
<compilation debug="false" explicit="true" defaultLanguage="vb">
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="1"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<compiler language="js;jscript;javascript" extension=".js" type="Microsoft.JScript.JScriptCodeProvider, Microsoft.JScript, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<compiler language="VJ#;VJS;VJSharp" extension=".jsl" type="Microsoft.VJSharp.VJSharpCodeProvider, VJSharpCodeProvider, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/></compilers>
<assemblies>
<add assembly="mscorlib"/>
<add assembly="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add assembly="System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add assembly="System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add assembly="System.Web.Services, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add assembly="System.Xml, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add assembly="System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add assembly="System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add assembly="*"/>
</assemblies>
</compilation>
<configuration>
<system.web>
<compilation defaultLanguage="VB"
debug="true"
numRecompilesBeforeAppRestart="15">
<compilers>
<compiler
language="VB;VBScript"
extension=".cls"
type="Microsoft.VisualBasic.VBCodeProvider,system,
Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"/>
<compiler
language="C#;Csharp"
extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider,system,
Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"/>
</compilers>
<assemblies>
<add assembly="ADODB"/>
<add assembly="*"/>
</assemblies>
<codeSubDirectories>
<codeSubDirectory directoryName="/aspnet/code/mySubDir1"/>
<codeSubDirectory directoryName="/aspnet/code/mySubDir2"/>
<codeSubDirectory directoryName="/aspnet/code/mySubDir3"/>
</codeSubDirectories>
<buildProviders>
<buildProvider
extension=".mafx" type="BuildProviderType,
BuildProviderAssembly"
/>
</buildProviders>
</compilation>
</system.web>
</configuration>
|
配置节处理程序 |
|
|
配置成员 |
|
|
可配置的位置 |
Machine.config 根级别的 Web.config 应用程序级别的 Web.config 虚拟或物理目录级别的 Web.config |
|
要求 |
Microsoft Internet 信息服务 (IIS) 5.0、5.1 或 6.0 .NET Framework 1.0、1.1、2.0 Visual Studio 2003 或 Visual Studio 2005 |
compilation 元素(ASP.NET 设置架构)的更多相关文章
- pages 元素(ASP.NET 设置架构)web.config 详解
pages 元素(ASP.NET 设置架构) buffer="[True|False]" enableEventValidation="[True|False] ...
- roleManager 元素(ASP.NET 设置架构),我是因为SSL弱密码(转)
为角色管理配置应用程序. 此元素是 .NET Framework 2.0 版中的新元素. configuration 元素(常规设置架构) system.web 元素(ASP.NET 设置架构) ...
- authorization 元素(ASP.NET 设置架构)
authorization 元素(ASP.NET 设置架构) 其他版本 1(共 1)对本文的评价是有帮助 - 评价此主题 [本文档仅供预览,在以后的发行版中可能会发生更改.包含的空白主题用作占位符.] ...
- customErrors 元素(ASP.NET 设置架构)
1.适用版本:.NET Framework 4 2.元素定义:为 ASP.NET 应用程序提供有关自定义错误消息的信息. 可以在应用程序文件层次结构中的任意级别上定义 customErrors 元素. ...
- 【配置】检测到在集成的托管管道模式下不适用的ASP.NET设置的解决方法(非简单设置为【经典】模式)。
× 检测到在集成的托管管道模式下不适用的ASP.NET设置的解决方法(非简单设置为[经典]模式). 我们将ASP.NET程序从IIS6移植到IIS7,可能运行提示以下错误: HTTP 错误 5 ...
- [翻译]了解ASP.NET底层架构(八)
原文地址:http://www.cnblogs.com/tmfc/archive/2006/09/04/493304.html [翻译]了解ASP.NET底层架构(完) [翻译]了解ASP.NET底层 ...
- 元素绝对定位以后设置了高宽,a标签不能点击的原因总结
元素绝对定位以后设置了高宽,a标签不能点击的原因: 1.元素内并无内容 2.背景是透明的,无任何背景图或者颜色 解决方法: 1.如果不是绝对定位元素的,可以用相对定位 2.给元素加透明的背景图 3.I ...
- 检测到在集成的托管管道模式下不适用的ASP.NET设置的解决方法(转)
我们将ASP.NET程序从IIS6移植到IIS7,可能运行提示以下错误: HTTP 错误 500.23 - Internal Server Error 检测到在集成的托管管道模式下不适用的 ASP.N ...
- HTTP 错误 500.23 - Internal Server Error 检测到在集成的托管管道模式下不适用的 ASP.NET 设置。
检测到在集成的托管管道模式下不适用的ASP.NET设置的解决方法(非简单设置为[经典]模式). - CatcherX 2014-03-11 11:03 27628人阅读 评论(2) 收藏 举报 分类 ...
随机推荐
- Android开发:碎片Fragment完全解析fragment_main.xml/activity_main.xml
Android开发:碎片Fragment完全解析 为了让界面可以在平板上更好地展示,Android在3.0版本引入了Fragment(碎片)功能,它非常类似于Activity,可以像 Activi ...
- Swift--基础(二)元组 断言 错误处理
元组(tuples) 把多个值组合成一个复合值.元组内的值可以是任意类型,并不要求是相同类型 let http404Error = (404, "Not Found") let ( ...
- StringBuilder 大量字符串时使用,速度比较快
public static void Main(string[] args) { Stopwatch sw = new Stopwatch(); //程序计时器 StringBuilder str = ...
- C++中的dynamic_cast和static_cast
代码: #include <cstdio> #include <iostream> using namespace std; class A{ public: virtual ...
- QML学习心得
Qt Quick之于QML,正如Qt 之于 C++,QML是Qt中开发的一个新的语言,而Qt Quick是这个语言的一个组件库,其中包含了很多用QML写的可以现成使用的组件. QML Hello Wo ...
- linux 下使用crontab+wget实现秒及定时任务
输入命令 crontab -e 打开一个文件,默认的编辑器为vi. 输入vi编辑器,输入i为插入,输入w保存,q退出,!强制.wq!强制保存并退出. * * * * * /usr/bin/wget - ...
- 神经网络及其简单实现(MATLAB)
转自:http://www.cnblogs.com/heaad/archive/2011/03/07/1976443.html 第0节.引例 本文以Fisher的Iris数据集作为神经网络程序的测试 ...
- repo sync 时的自动续接脚本[转]
按理说在repo init ....之后使用repo sync就可以开始下载源码了,但是在下载过程中经常会出现没网速“死”的情况.当然,我修改了/etc/hosts文件之后就再也么有死过.在没网速提 ...
- Cmake设置环境变量
references: http://stackoverflow.com/questions/21047399/cmake-set-environment-variables-from-a-scrip ...
- Android SDK 下载速度慢解决方法
Mac 本搞Android开发,遇到Android SDK 下载速度慢,解决方法大概有两种.第一,FQ.这种方法比较彻底,但是要想有稳定的效果还的要花大价钱.第二,有些高人直接给了SDK中各软件的下载 ...
注意