AppDomain.ClearPrivatePath-Methode

HINWEIS: Diese Methode ist mittlerweile veraltet.

Setzt den Pfad, der den Speicherort von privaten Assemblys angibt, auf die leere Zeichenfolge ("") zurück.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

'Declaration
<ObsoleteAttribute("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. https://go.microsoft.com/fwlink/?linkid=14202")> _
Public Sub ClearPrivatePath
'Usage
Dim instance As AppDomain

instance.ClearPrivatePath
[ObsoleteAttribute("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. https://go.microsoft.com/fwlink/?linkid=14202")] 
public void ClearPrivatePath ()
[ObsoleteAttribute(L"AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. https://go.microsoft.com/fwlink/?linkid=14202")] 
public:
virtual void ClearPrivatePath () sealed
/** @attribute ObsoleteAttribute("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. https://go.microsoft.com/fwlink/?linkid=14202") */ 
public final void ClearPrivatePath ()
ObsoleteAttribute("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. https://go.microsoft.com/fwlink/?linkid=14202") 
public final function ClearPrivatePath ()

Ausnahmen

Ausnahmetyp Bedingung

AppDomainUnloadedException

Es wird versucht, die Operationen für eine entladene Anwendungsdomäne auszuführen.

Hinweise

Der private Pfad ist ein Pfad relativ zum Basisverzeichnis, den die Common Language Runtime bei der Suche nach privaten Assemblys durchsucht.

Weitere Informationen finden Sie unter AppDomainSetup.PrivateBinPath.

Beispiel

Imports System
Imports System.Reflection
Imports System.Security.Policy 'for evidence object

Class ADAppendPrivatePath
   
   Public Shared Sub Main()
      'Create evidence for new appdomain.
      Dim adevidence As Evidence = AppDomain.CurrentDomain.Evidence
      
      'Create the new application domain.
      Dim domain As AppDomain = AppDomain.CreateDomain("MyDomain", adevidence)
      
      'Display the current relative search path.
      Console.WriteLine("Relative search path is: " & domain.RelativeSearchPath)
      
      'Append the relative path.
      Dim Newpath As [String] = "www.code.microsoft.com"
      domain.AppendPrivatePath(Newpath)
      
      'Display the new relative search path.
      Console.WriteLine("Relative search path is: " & domain.RelativeSearchPath)
      
      'Clear the private search path.
      domain.ClearPrivatePath()
      
      'Display the new relative search path.
      Console.WriteLine("Relative search path is now: " & domain.RelativeSearchPath)
      
      
      AppDomain.Unload(domain)
   End Sub 'Main
End Class 'ADAppendPrivatePath
using System;
using System.Reflection;
using System.Security.Policy;  //for evidence object

class ADAppendPrivatePath
{
    public static void Main()
    {
        //Create evidence for new appdomain.
        Evidence adevidence = AppDomain.CurrentDomain.Evidence;

        //Create the new application domain.
        AppDomain domain = AppDomain.CreateDomain("MyDomain", adevidence);

        //Display the current relative search path.
        Console.WriteLine("Relative search path is: " + domain.RelativeSearchPath);

        //Append the relative path.
        String Newpath = "www.code.microsoft.com";
        domain.AppendPrivatePath(Newpath);

        //Display the new relative search path.
        Console.WriteLine("Relative search path is: " + domain.RelativeSearchPath);

        //Clear the private search path.
        domain.ClearPrivatePath();

        //Display the new relative search path.
        Console.WriteLine("Relative search path is now: " + domain.RelativeSearchPath);

 
        AppDomain.Unload(domain);   
    }
}
using namespace System;
using namespace System::Reflection;
using namespace System::Security::Policy;

//for evidence Object
int main()
{
   
   //Create evidence for new appdomain.
   Evidence^ adevidence = AppDomain::CurrentDomain->Evidence;
   
   //Create the new application domain.
   AppDomain^ domain = AppDomain::CreateDomain( "MyDomain", adevidence );
   
   //Display the current relative search path.
   Console::WriteLine( "Relative search path is: {0}", domain->RelativeSearchPath );
   
   //Append the relative path.
   String^ Newpath = "www.code.microsoft.com";
   domain->AppendPrivatePath( Newpath );
   
   //Display the new relative search path.
   Console::WriteLine( "Relative search path is: {0}", domain->RelativeSearchPath );
   
   //Clear the private search path.
   domain->ClearPrivatePath();
   
   //Display the new relative search path.
   Console::WriteLine( "Relative search path is now: {0}", domain->RelativeSearchPath );
   AppDomain::Unload( domain );
}

.NET Framework-Sicherheit

Plattformen

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

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 1.0, 1.1
Veraltet (Compilerwarnung) in 2.0

Siehe auch

Referenz

AppDomain-Klasse
AppDomain-Member
System-Namespace
String.Empty