AppDomain.ClearPrivatePath メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
注意事項
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
プライベート アセンブリの場所を指定するパスを空の文字列 ("") にリセットします。
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. 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
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」を参照してください。