AppDomain.ClearPrivatePath 메서드
참고: 이 메서드는 이제 사용되지 않습니다.
전용 어셈블리의 위치를 지정하는 경로를 빈 문자열("")로 다시 설정합니다.
네임스페이스: System
어셈블리: mscorlib(mscorlib.dll)
구문
‘선언
<ObsoleteAttribute("AppDomain.ClearPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead. https://go.microsoft.com/fwlink/?linkid=14202")> _
Public Sub ClearPrivatePath
‘사용 방법
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 ()
예외
예외 형식 | 조건 |
---|---|
언로드된 응용 프로그램 도메인에서 작업을 시도한 경우 |
설명
전용 경로는 공용 언어 런타임에서 전용 어셈블리를 찾기 위해 검색하는 기본 디렉터리에 대한 상대 경로입니다.
자세한 내용은 AppDomainSetup.PrivateBinPath를 참조하십시오.
예제
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 보안
- SecurityPermission 응용 프로그램 도메인을 만들고 조작하는 데 필요한 권한입니다. 연관된 열거형: SecurityPermissionFlag.ControlAppDomain
플랫폼
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에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
1.0, 1.1에서 지원
2.0에서 사용되지 않음(컴파일러 경고)