NamespaceCollection.AutoImportVBNamespace Property

Definition

Gets or sets a value that determines whether the Visual Basic namespace is imported without having to specify it.

C#
[System.Configuration.ConfigurationProperty("autoImportVBNamespace", DefaultValue=true)]
public bool AutoImportVBNamespace { get; set; }

Property Value

true if the Visual Basic namespace is imported automatically; otherwise, false. The default is true.

Attributes

Examples

The following code example shows how to use the AutoImportVBNamespace property. This code example is part of a larger example provided for the PagesSection class.

C#
// Get the AutoImportVBNamespace property.
Console.WriteLine("AutoImportVBNamespace: '{0}'",
    pagesSection.Namespaces.AutoImportVBNamespace.ToString());

// Set the AutoImportVBNamespace property.
pagesSection.Namespaces.AutoImportVBNamespace = true;

Remarks

For ASP.NET pages written using Visual Basic the Microsoft.VisualBasic namespace is automatically imported unless the AutoImportVBNamespace property is false.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also