Name

<compiler>

Synopsis

<compiler language=languageAlias
   extension=fileExt
   type=typeName 
   warningLevel=number 
   compilerOptions=optionString />

Specifies configuration options for a given language.

Scope

Any

Attributes

language

Specifies the name or names by which the language will be specified in the language attribute of the @ Page directive. Multiple names should be separated by semicolons. This attribute is required.

extension

Specifies the extension(s) used by code-behind files for the specified language. Multiple entries should be separated by semicolons. This attribute is required.

type

Specifies the .NET type information for the class to be used to compile resources for the specified language. This attribute is required.

warningLevel

Specifies the compiler warning level for the language. This attribute is optional and may not be supported for all compilers.

compilerOptions

Specifies a string containing valid compiler options to be passed to the compiler.

Child Elements

None

Notes

The <compilers> element in machine.config provides a good example of the use of this element. Review that configuration section to see how the Visual Basic .NET, C#, and JScript .NET compilers are configured.

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.