This documentation is archived and is not being maintained.

CompilationSection.Strict Property

Gets or sets the Visual Basic strict compile option.

Namespace: System.Web.Configuration
Assembly: System.Web (in system.web.dll)

public bool Strict { get; set; }
/** @property */
public boolean get_Strict ()

/** @property */
public void set_Strict (boolean value)

public function get Strict () : boolean

public function set Strict (value : boolean)

Not applicable.

Property Value

true if the Visual Basic strict compile option is used; otherwise, false. The default is true.

When true, compilation explicitly disallows any data-type conversions in which data loss would occur, and any conversion between numeric types and strings.

The following code example demonstrates how to use the Strict property. This code example is part of a larger example provided for the CompilationSection class.

// Display Strict property.
Console.WriteLine("Strict: {0}", 

// Set Strict property.
configSection.Strict = false;

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0