This documentation is archived and is not being maintained.

IVsaEngine.RootNamespace Property

Sets or gets the root namespace used by the script engine.

[Visual Basic]
Property RootNamespace As String
string RootNamespace {get; set;}
__property String* get_RootNamespace();
__property void set_RootNamespace(String*);
function get RootNamespace() : String;function set RootNamespace(String);

Property Value

Returns the string value of the root namespace.


Although the RootNamespace property can be set at any time, specific circumstances require that it must be set:

This property is initially set to the empty string. However, it must be set to a valid namespace identifier before calling the IVsaEngine.Compile method. The host must set the proper RootNamespace property value for a script engine before it can run customization code.

The following table shows the exceptions that the RootNamespace property can throw.

Exception Type Condition
EngineClosed The IVsaEngine.Close method has been called and the engine is closed.
EngineBusy The engine is currently executing code for another thread.
EngineNotInitialized The engine has not been initialized.
EngineRunning The engine is currently running.
NamespaceInvalid An invalid namespace was specified which contains illegal characters.


The following example shows how to set the RootNamespace property of the engine to the string "MyApp.MyNamespace":

// Set the root namespace and compile.
myEngine.RootNamespace = "MyApp.MyNamespace";


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IVsaEngine Interface | IVsaEngine Members | Microsoft.Vsa Namespace | IVsaEngine.Compile | IVsaSite.GetCompiledState