言語

RootCommand.ExecutableName プロパティ

定義

現在実行中の実行可能ファイルの名前。

public:
 static property System::String ^ ExecutableName { System::String ^ get(); };
public static string ExecutableName { get; }
static member ExecutableName : string
Public Shared ReadOnly Property ExecutableName As String

プロパティ値

注釈

名前は次の順序で解決されます。

  1. マネージド エントリ ポイントがない場合 (GetEntryAssembly()nullを返します)、特に NativeAOT ネイティブ ライブラリとしてホストされている場合に、AppContextから読み取られたSystem.CommandLine.ExecutableName値。 その場合、 GetCommandLineArgs() はこのコンポーネントではなくホスト プロセスを反映します。 この値は、System.CommandLine ビルド ターゲットによってアプリのruntimeconfig.jsonに出力され、既定ではアセンブリ名になります。
  2. GetCommandLineArgs()から現在実行中の実行可能ファイルのファイル名 (拡張子なし)。
  3. 実行可能パスが使用できなかった場合の、AppContextからのSystem.CommandLine.ExecutableName値。
  4. リテラルは、最終的なフォールバックとして "app"

適用対象