다음을 통해 공유


AppDomain.ClearPrivatePath 메서드

정의

주의

AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. https://go.microsoft.com/fwlink/?linkid=14202

주의

AppDomain.ClearPrivatePath has been deprecated and is not supported.

주의

AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. http://go.microsoft.com/fwlink/?linkid=14202

주의

AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead.

프라이빗 어셈블리의 위치를 지정하는 경로를 빈 문자열("")로 다시 설정합니다.

public:
 void ClearPrivatePath();
public:
 virtual void ClearPrivatePath();
[System.Obsolete("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. https://go.microsoft.com/fwlink/?linkid=14202")]
public void ClearPrivatePath ();
[System.Obsolete("AppDomain.ClearPrivatePath has been deprecated and is not supported.")]
public void ClearPrivatePath ();
[System.Obsolete("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. http://go.microsoft.com/fwlink/?linkid=14202")]
public void ClearPrivatePath ();
public void ClearPrivatePath ();
[System.Obsolete("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. http://go.microsoft.com/fwlink/?linkid=14202")]
[System.Security.SecurityCritical]
public void ClearPrivatePath ();
[System.Obsolete("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead.")]
public void ClearPrivatePath ();
[<System.Obsolete("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. https://go.microsoft.com/fwlink/?linkid=14202")>]
member this.ClearPrivatePath : unit -> unit
[<System.Obsolete("AppDomain.ClearPrivatePath has been deprecated and is not supported.")>]
member this.ClearPrivatePath : unit -> unit
[<System.Obsolete("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. http://go.microsoft.com/fwlink/?linkid=14202")>]
member this.ClearPrivatePath : unit -> unit
abstract member ClearPrivatePath : unit -> unit
override this.ClearPrivatePath : unit -> unit
[<System.Obsolete("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. http://go.microsoft.com/fwlink/?linkid=14202")>]
abstract member ClearPrivatePath : unit -> unit
override this.ClearPrivatePath : unit -> unit
[<System.Obsolete("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. http://go.microsoft.com/fwlink/?linkid=14202")>]
[<System.Security.SecurityCritical>]
abstract member ClearPrivatePath : unit -> unit
override this.ClearPrivatePath : unit -> unit
[<System.Obsolete("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead.")>]
member this.ClearPrivatePath : unit -> unit
[<System.Obsolete("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead.")>]
abstract member ClearPrivatePath : unit -> unit
override this.ClearPrivatePath : unit -> unit
Public Sub ClearPrivatePath ()

구현

특성

예외

언로드된 애플리케이션 도메인에서 작업이 시도됩니다.

예제

다음 코드 예제에서는 어셈블리가 로드될 때 검색할 프라이빗 경로 목록에서 모든 항목을 제거하는 방법을 보여 ClearPrivatePath 줍니다.

이 메서드는 이제 사용되지 않으며 새 개발에 사용해서는 안 됩니다.

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 );
}
using System;
using System.Reflection;
using System.Security.Policy;

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);	
    }
}
open System

//Create evidence for new appdomain.
let adevidence = AppDomain.CurrentDomain.Evidence

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

//Display the current relative search path.
printfn $"Relative search path is: {domain.RelativeSearchPath}"

//Append the relative path.
let Newpath = "www.code.microsoft.com"
domain.AppendPrivatePath Newpath

//Display the new relative search path.
printfn $"Relative search path is: {domain.RelativeSearchPath}"

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

//Display the new relative search path.
printfn $"Relative search path is now: {domain.RelativeSearchPath}"

AppDomain.Unload domain
Imports System.Reflection
Imports System.Security.Policy

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
End Class

설명

프라이빗 경로는 공용 언어 런타임이 프라이빗 어셈블리를 찾기 위해 검색하는 기본 디렉터리에 상대적인 경로입니다.

자세한 내용은 AppDomainSetup.PrivateBinPath를 참조하세요.

적용 대상

추가 정보