Gets the friendly name of this application domain.
Namespace:
System
Assembly:
mscorlib (in mscorlib.dll)
Visual Basic (Declaration)
Public ReadOnly Property FriendlyName As String
Dim instance As AppDomain
Dim value As String
value = instance.FriendlyName
public string FriendlyName { get; }
public:
virtual property String^ FriendlyName {
String^ get () sealed;
}
public final function get FriendlyName () : String
Implements
_AppDomain..::.FriendlyName
The friendly name of the default application domain is the file name of the process executable. For example, if the executable used to start the process is "c:\MyAppDirectory\MyAssembly.exe", the friendly name of the default application domain is "MyAssembly.exe".
The following code example uses the FriendlyName property to get the friendly name of the current application domain. For the default application domain, the friendly name is the name of the application's executable file. The code example also displays additional information about the application domain.
Imports System
Imports System.Reflection
Imports System.Security.Policy 'for evidence object
Class ADSetupInformation
Public Shared Sub Main()
' Create the applcation domain setup information.
Dim domaininfo As New AppDomainSetup()
domaininfo.ApplicationBase = System.Environment.CurrentDirectory
'Create evidence for the new appdomain.
Dim adevidence As Evidence = AppDomain.CurrentDomain.Evidence
' Create the new application domain using setup information.
Dim domain As AppDomain = AppDomain.CreateDomain("MyDomain", adevidence, domaininfo)
' Write out the application domain information.
Console.WriteLine("Host domain: " + AppDomain.CurrentDomain.FriendlyName)
Console.WriteLine("new child domain: " + domain.FriendlyName)
Console.WriteLine()
Console.WriteLine("Application base is: " + domain.SetupInformation.ApplicationBase)
AppDomain.Unload(domain)
End Sub
End Class 'ADSetupInformation
using System;
using System.Reflection;
using System.Security.Policy; //for evidence object
class ADSetupInformation
{
public static void Main()
{
//Create the application domain setup information.
AppDomainSetup domaininfo = new AppDomainSetup();
domaininfo.ApplicationBase = System.Environment.CurrentDirectory;
//Create evidence for new appdomain.
Evidence adevidence = AppDomain.CurrentDomain.Evidence;
// Create the new application domain using setup information.
AppDomain domain = AppDomain.CreateDomain("MyDomain", adevidence, domaininfo);
// Write out the application domain information.
Console.WriteLine("Host domain: " + AppDomain.CurrentDomain.FriendlyName);
Console.WriteLine("new child domain: " + domain.FriendlyName);
Console.WriteLine();
Console.WriteLine("Application base is: " + domain.SetupInformation.ApplicationBase);
AppDomain.Unload(domain);
}
}
using namespace System;
using namespace System::Reflection;
using namespace System::Security::Policy;
//for evidence Object
int main()
{
//Create the application domain setup information.
AppDomainSetup^ domaininfo = gcnew AppDomainSetup;
domaininfo->ApplicationBase = System::Environment::CurrentDirectory;
//Create evidence for new appdomain.
Evidence^ adevidence = AppDomain::CurrentDomain->Evidence;
// Create the new application domain using setup information.
AppDomain^ domain = AppDomain::CreateDomain( "MyDomain", adevidence, domaininfo );
// Write Out the application domain information.
Console::WriteLine( "Host domain: {0}", AppDomain::CurrentDomain->FriendlyName );
Console::WriteLine( "new child domain: {0}", domain->FriendlyName );
Console::WriteLine();
Console::WriteLine( "Application base is: {0}", domain->SetupInformation->ApplicationBase );
AppDomain::Unload( domain );
}
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
.NET Compact Framework
Supported in: 3.5, 2.0, 1.0
XNA Framework
Supported in: 3.0, 2.0, 1.0
Reference