99 instantiations of Process
aspire (13)
Agents\ClaudeCode\ClaudeCodeCliRunner.cs (1)
38using var process = new Process { StartInfo = startInfo };
Agents\CopilotCli\CopilotCliRunner.cs (1)
38using var process = new Process { StartInfo = startInfo };
Agents\OpenCode\OpenCodeCliRunner.cs (1)
38using var process = new Process { StartInfo = startInfo };
Agents\Playwright\PlaywrightCliRunner.cs (2)
35using var process = new Process { StartInfo = startInfo }; 104using var process = new Process { StartInfo = startInfo };
Agents\VsCode\VsCodeCliRunner.cs (1)
39using var process = new Process { StartInfo = startInfo };
DotNet\DotNetCliExecutionFactory.cs (1)
92var process = new Process { StartInfo = startInfo };
DotNet\DotNetSdkInstaller.cs (1)
32using var process = new Process
Git\GitRepository.cs (1)
32using var process = new Process { StartInfo = startInfo };
Layout\LayoutProcessRunner.cs (1)
81var process = new Process();
Npm\NpmRunner.cs (1)
247using var process = new Process { StartInfo = startInfo };
OpenCode\OpenCodeCliRunner.cs (1)
31using var process = new Process { StartInfo = startInfo };
Projects\ProcessGuestLauncher.cs (1)
66using var process = new Process { StartInfo = startInfo };
Aspire.Cli.EndToEnd.Tests (2)
KubernetesPublishTests.cs (1)
314using var cleanupProcess = new System.Diagnostics.Process();
tests\Shared\TemporaryRepo.cs (1)
22using var process = new Process
Aspire.Cli.Tests (1)
tests\Shared\TemporaryRepo.cs (1)
22using var process = new Process
Aspire.Deployment.EndToEnd.Tests (28)
AcaCompactNamingDeploymentTests.cs (1)
192var process = new System.Diagnostics.Process
AcaCompactNamingUpgradeDeploymentTests.cs (1)
306var process = new System.Diagnostics.Process
AcaCustomRegistryDeploymentTests.cs (1)
262var process = new System.Diagnostics.Process
AcaDeploymentErrorOutputTests.cs (1)
192var process = new System.Diagnostics.Process
AcaExistingRegistryDeploymentTests.cs (1)
286var process = new System.Diagnostics.Process
AcaManagedRedisDeploymentTests.cs (1)
364var process = new System.Diagnostics.Process
AcaStarterDeploymentTests.cs (1)
231var process = new System.Diagnostics.Process
AcrPurgeTaskDeploymentTests.cs (1)
293var process = new System.Diagnostics.Process
AksStarterDeploymentTests.cs (1)
379var process = new System.Diagnostics.Process
AksStarterWithRedisDeploymentTests.cs (1)
407var process = new System.Diagnostics.Process
AppServicePythonDeploymentTests.cs (1)
216var process = new System.Diagnostics.Process
AppServiceReactDeploymentTests.cs (1)
231var process = new System.Diagnostics.Process
AzureAppConfigDeploymentTests.cs (1)
197var process = new System.Diagnostics.Process
AzureContainerRegistryDeploymentTests.cs (1)
172var process = new System.Diagnostics.Process
AzureEventHubsDeploymentTests.cs (1)
197var process = new System.Diagnostics.Process
AzureKeyVaultDeploymentTests.cs (1)
197var process = new System.Diagnostics.Process
AzureLogAnalyticsDeploymentTests.cs (1)
172var process = new System.Diagnostics.Process
AzureServiceBusDeploymentTests.cs (1)
199var process = new System.Diagnostics.Process
AzureStorageDeploymentTests.cs (1)
204var process = new System.Diagnostics.Process
PythonFastApiDeploymentTests.cs (1)
217var process = new System.Diagnostics.Process
tests\Shared\TemporaryRepo.cs (1)
22using var process = new Process
TypeScriptExpressDeploymentTests.cs (1)
212var process = new System.Diagnostics.Process
VnetKeyVaultConnectivityDeploymentTests.cs (1)
281var process = new System.Diagnostics.Process
VnetKeyVaultInfraDeploymentTests.cs (1)
212var process = new System.Diagnostics.Process
VnetSqlServerConnectivityDeploymentTests.cs (1)
282var process = new System.Diagnostics.Process
VnetSqlServerInfraDeploymentTests.cs (1)
213var process = new System.Diagnostics.Process
VnetStorageBlobConnectivityDeploymentTests.cs (1)
288var process = new System.Diagnostics.Process
VnetStorageBlobInfraDeploymentTests.cs (1)
214var process = new System.Diagnostics.Process
Aspire.EndToEnd.Tests (2)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
178AppHostProcess = new Process();
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
228return new Process
Aspire.Hosting (1)
Dcp\Process\ProcessUtil.cs (1)
22var process = new System.Diagnostics.Process()
Aspire.Hosting.Azure (1)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (1)
22var process = new System.Diagnostics.Process()
Aspire.Hosting.DevTunnels (1)
DevTunnelCli.cs (1)
237using var process = new Process
Aspire.Hosting.Docker (1)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (1)
22var process = new System.Diagnostics.Process()
Aspire.Hosting.Tests (2)
MSBuildTests.cs (2)
226using var process = new Process(); 553using var process = new Process();
Aspire.Templates.Tests (2)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
178AppHostProcess = new Process();
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
228return new Process
dotnet (2)
CommandFactory\CommandFactoryUsingResolver.cs (1)
118var _process = new Process
Commands\Help\HelpCommand.cs (1)
77return new Process
dotnet-format (1)
Utilities\ProcessRunner.cs (1)
77var process = new Process();
dotnet-suggest (1)
SuggestionStore.cs (1)
38using (var process = new Process
dotnet-svcutil-lib (1)
Shared\Utilities\ProcessRunner.cs (1)
68using (var proc = new Process())
dotnet-user-jwts (1)
src\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (1)
79using var process = new Process()
dotnet-user-secrets (1)
src\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (1)
79using var process = new Process()
Infrastructure.Tests (4)
ExtractTestPartitions\ExtractTestPartitionsFixture.cs (1)
32using var process = new Process { StartInfo = psi };
ExtractTestPartitions\ExtractTestPartitionsTests.cs (1)
313using var process = new Process { StartInfo = psi };
PowerShellScripts\PowerShellCommand.cs (1)
214return new Process
WorkflowScripts\NodeCommand.cs (1)
199return new Process
Microsoft.Agents.AI.ProjectTemplates.Tests (1)
test\ProjectTemplates\Infrastructure\TestCommand.cs (1)
55using var process = new Process
Microsoft.Arcade.Common (1)
Command.cs (1)
43_process = new Process()
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
381 using (var launchBrowser = new Process())
Microsoft.AspNetCore.Components.WebView.Wpf (1)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
381 using (var launchBrowser = new Process())
Microsoft.Build.Utilities.Core (1)
ToolTask.cs (1)
786proc = new Process();
Microsoft.DotNet.Cli.Utils (2)
Extensions\ProcessStartInfoExtensions.cs (2)
14var process = new Process 37var process = new Process
Microsoft.DotNet.HotReload.Watch (1)
Process\ProcessRunner.cs (1)
144var process = new Process
Microsoft.DotNet.MacOsPkg.Core (1)
ExecuteHelper.cs (1)
23using (Process process = new Process { StartInfo = processStartInfo })
Microsoft.Extensions.AI.Templates.Tests (1)
test\ProjectTemplates\Infrastructure\TestCommand.cs (1)
55using var process = new Process
Microsoft.Extensions.DataIngestion.MarkItDown (1)
MarkItDownReader.cs (1)
75using (Process process = new() { StartInfo = startInfo })
Microsoft.Extensions.DataIngestion.Tests (1)
Readers\MarkItDownConditionAttribute.cs (1)
36using Process process = new() { StartInfo = startInfo };
Microsoft.McpServer.ProjectTemplates.Tests (1)
test\ProjectTemplates\Infrastructure\TestCommand.cs (1)
55using var process = new Process
Microsoft.ML.CodeGenerator (3)
Utils.cs (3)
195var proc = new System.Diagnostics.Process(); 221var proc = new System.Diagnostics.Process(); 242var proc = new System.Diagnostics.Process();
Microsoft.ML.Sweeper (1)
ConfigRunner.cs (1)
226var p = new System.Diagnostics.Process
Microsoft.NET.Build.Containers (1)
LocalDaemons\DockerCli.cs (1)
203Process proc = new()
Microsoft.NET.Sdk.Publish.Tasks (1)
Tasks\GenerateEFSQLScripts.cs (1)
106proc = new Process
Microsoft.TestPlatform.Build (1)
Tasks\VSTestTask.cs (1)
87using var activeProcess = new Process { StartInfo = processInfo };
Microsoft.TestPlatform.Extensions.BlameDataCollector (1)
ProcessCodeMethods.cs (1)
139Process ps = new();
Microsoft.TestPlatform.PlatformAbstractions (1)
common\System\ProcessHelper.cs (1)
63var process = new Process();
NuGet.Build.Tasks (1)
StaticGraphRestoreTaskBase.cs (1)
117using (var process = new Process())
NuGet.Common (1)
Migrations\Migration1.cs (1)
201using (var proc = new Process())
NuGet.Packaging (1)
NuGetExtractionFileIO.cs (1)
108using (var process = new Process())
NuGet.Protocol (1)
Plugins\PluginProcess.cs (1)
83_process = new Process();
PresentationUI (2)
InstallationError.xaml.cs (1)
211Process Notepad = new Process();
TenFeetInstallationError.xaml.cs (1)
215Process Notepad = new Process();
System.Diagnostics.Process (5)
System\Diagnostics\Process.cs (5)
919return new Process(machineName, isRemoteMachine, processId, null); 936return new Process(".", false, processId, null); 1018processes[i] = new Process(machineName, isRemoteMachine, processInfo.ProcessId, processInfo); 1033return new Process(".", false, Environment.ProcessId, null); 1381Process process = new Process();
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.PingUtility.cs (1)
48return new Process() { StartInfo = psi };
782 references to Process
aspire (90)
Agents\ClaudeCode\ClaudeCodeCliRunner.cs (1)
38using var process = new Process { StartInfo = startInfo };
Agents\CopilotCli\CopilotCliRunner.cs (1)
38using var process = new Process { StartInfo = startInfo };
Agents\OpenCode\OpenCodeCliRunner.cs (1)
38using var process = new Process { StartInfo = startInfo };
Agents\Playwright\PlaywrightCliRunner.cs (2)
35using var process = new Process { StartInfo = startInfo }; 104using var process = new Process { StartInfo = startInfo };
Agents\VsCode\VsCodeCliRunner.cs (1)
39using var process = new Process { StartInfo = startInfo };
Certificates\CertificateGeneration\MacOSCertificateManager.cs (12)
104using (var process = Process.Start(MacOSTrustCertificateCommandLine, s_macOSTrustCertificateCommandLineArguments + tmpFile)) 159using var checkTrustProcess = Process.Start(new ProcessStartInfo( 214using var process = Process.Start(processInfo); 257using (var process = Process.Start(processInfo)) 288using var findCertificateProcess = Process.Start(new ProcessStartInfo( 358using (var process = Process.Start(processInfo))
Certificates\CertificateGeneration\UnixCertificateManager.cs (12)
694using var process = Process.Start(startInfo)!; 717using var process = Process.Start(startInfo)!; 746using var process = Process.Start(startInfo)!; 770using var process = Process.Start(startInfo)!; 942using var process = Process.Start(processInfo); 986using var process = Process.Start(processInfo);
Certificates\CertificateHelpers.cs (2)
100using var process = Process.Start(processInfo);
Commands\AppHostLauncher.cs (2)
215private record LaunchResult(Process? ChildProcess, IAppHostAuxiliaryBackchannel? Backchannel, DashboardUrlsState? DashboardUrls, bool ChildExitedEarly, int ChildExitCode); 223Process childProcess;
Commands\StopCommand.cs (2)
296using var process = Process.GetProcessById(pid);
Commands\UpdateCommand.cs (2)
501using var process = Process.Start(psi);
DotNet\DotNetCliExecution.cs (2)
14private readonly Process _process; 20internal DotNetCliExecution(Process process, ILogger logger, DotNetCliRunnerInvocationOptions options)
DotNet\DotNetCliExecutionFactory.cs (2)
22var startTime = Process.GetCurrentProcess().StartTime; 92var process = new Process { StartInfo = startInfo };
DotNet\DotNetSdkInstaller.cs (1)
32using var process = new Process
Git\GitRepository.cs (1)
32using var process = new Process { StartInfo = startInfo };
Layout\LayoutProcessRunner.cs (5)
42using var process = CreateProcess(toolPath, arguments, workingDirectory, environmentVariables, redirectOutput: true); 58public static Process Start( 65var process = CreateProcess(toolPath, arguments, workingDirectory, environmentVariables, redirectOutput); 74private static Process CreateProcess( 81var process = new Process();
Npm\NpmRunner.cs (1)
247using var process = new Process { StartInfo = startInfo };
OpenCode\OpenCodeCliRunner.cs (1)
31using var process = new Process { StartInfo = startInfo };
Processes\DetachedProcessLauncher.cs (2)
70/// <returns>A <see cref="Process"/> object representing the launched child.</returns> 71public static Process Start(string fileName, IReadOnlyList<string> arguments, string workingDirectory)
Processes\DetachedProcessLauncher.Unix.cs (3)
18private static Process StartUnix(string fileName, IReadOnlyList<string> arguments, string workingDirectory) 36var process = Process.Start(startInfo)
Processes\DetachedProcessLauncher.Windows.cs (3)
20private static Process StartWindows(string fileName, IReadOnlyList<string> arguments, string workingDirectory) 106Process detachedProcess; 109detachedProcess = Process.GetProcessById(pi.dwProcessId);
Program.cs (2)
707var currentProcess = Process.GetCurrentProcess();
Projects\AppHostServerSession.cs (3)
17private readonly Process _serverProcess; 24Process serverProcess, 39public Process ServerProcess => _serverProcess;
Projects\DotNetBasedAppHostServerProject.cs (5)
467public (string SocketPath, Process Process, OutputCollector OutputCollector) Run( 520var process = Process.Start(startInfo)!; 559using var process = Process.Start(startInfo);
Projects\GuestAppHostProject.cs (1)
938Process process,
Projects\IAppHostServerProject.cs (1)
58(string SocketPath, Process Process, OutputCollector OutputCollector) Run(
Projects\IAppHostServerSession.cs (1)
25Process ServerProcess { get; }
Projects\PrebuiltAppHostServer.cs (3)
404public (string SocketPath, Process Process, OutputCollector OutputCollector) Run( 482var process = Process.Start(startInfo)!;
Projects\ProcessGuestLauncher.cs (1)
66using var process = new Process { StartInfo = startInfo };
Projects\RunningInstanceManager.cs (2)
111var process = Process.GetProcessById(pid);
src\Shared\BackchannelConstants.cs (2)
251using var process = Process.GetProcessById(pid);
Utils\CliDownloader.cs (2)
132using var process = Process.Start(psi);
Utils\EnvironmentChecker\ContainerRuntimeCheck.cs (6)
101using var versionProcess = Process.Start(versionProcessInfo); 250using var psProcess = Process.Start(psProcessInfo); 465using var process = Process.Start(processInfo);
Utils\EnvironmentChecker\DeprecatedWorkloadCheck.cs (2)
36using var process = Process.Start(processInfo);
Aspire.Cli.EndToEnd.Tests (2)
KubernetesPublishTests.cs (1)
314using var cleanupProcess = new System.Diagnostics.Process();
tests\Shared\TemporaryRepo.cs (1)
22using var process = new Process
Aspire.Cli.Tests (1)
tests\Shared\TemporaryRepo.cs (1)
22using var process = new Process
Aspire.Deployment.EndToEnd.Tests (28)
AcaCompactNamingDeploymentTests.cs (1)
192var process = new System.Diagnostics.Process
AcaCompactNamingUpgradeDeploymentTests.cs (1)
306var process = new System.Diagnostics.Process
AcaCustomRegistryDeploymentTests.cs (1)
262var process = new System.Diagnostics.Process
AcaDeploymentErrorOutputTests.cs (1)
192var process = new System.Diagnostics.Process
AcaExistingRegistryDeploymentTests.cs (1)
286var process = new System.Diagnostics.Process
AcaManagedRedisDeploymentTests.cs (1)
364var process = new System.Diagnostics.Process
AcaStarterDeploymentTests.cs (1)
231var process = new System.Diagnostics.Process
AcrPurgeTaskDeploymentTests.cs (1)
293var process = new System.Diagnostics.Process
AksStarterDeploymentTests.cs (1)
379var process = new System.Diagnostics.Process
AksStarterWithRedisDeploymentTests.cs (1)
407var process = new System.Diagnostics.Process
AppServicePythonDeploymentTests.cs (1)
216var process = new System.Diagnostics.Process
AppServiceReactDeploymentTests.cs (1)
231var process = new System.Diagnostics.Process
AzureAppConfigDeploymentTests.cs (1)
197var process = new System.Diagnostics.Process
AzureContainerRegistryDeploymentTests.cs (1)
172var process = new System.Diagnostics.Process
AzureEventHubsDeploymentTests.cs (1)
197var process = new System.Diagnostics.Process
AzureKeyVaultDeploymentTests.cs (1)
197var process = new System.Diagnostics.Process
AzureLogAnalyticsDeploymentTests.cs (1)
172var process = new System.Diagnostics.Process
AzureServiceBusDeploymentTests.cs (1)
199var process = new System.Diagnostics.Process
AzureStorageDeploymentTests.cs (1)
204var process = new System.Diagnostics.Process
PythonFastApiDeploymentTests.cs (1)
217var process = new System.Diagnostics.Process
tests\Shared\TemporaryRepo.cs (1)
22using var process = new Process
TypeScriptExpressDeploymentTests.cs (1)
212var process = new System.Diagnostics.Process
VnetKeyVaultConnectivityDeploymentTests.cs (1)
281var process = new System.Diagnostics.Process
VnetKeyVaultInfraDeploymentTests.cs (1)
212var process = new System.Diagnostics.Process
VnetSqlServerConnectivityDeploymentTests.cs (1)
282var process = new System.Diagnostics.Process
VnetSqlServerInfraDeploymentTests.cs (1)
213var process = new System.Diagnostics.Process
VnetStorageBlobConnectivityDeploymentTests.cs (1)
288var process = new System.Diagnostics.Process
VnetStorageBlobInfraDeploymentTests.cs (1)
214var process = new System.Diagnostics.Process
Aspire.EndToEnd.Tests (5)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
26public Process? AppHostProcess { get; private set; }
tests\Shared\TemplatesTesting\TestExtensions.cs (2)
20public static bool TryGetHasExited(this Process process) 32public static void CloseAndKillProcessIfRunning(this Process process)
tests\Shared\TemplatesTesting\ToolCommand.cs (2)
19public Process? CurrentProcess { get; private set; } 208private Process CreateProcess(string executable, string args)
Aspire.Hosting (11)
ApplicationModel\ProjectRebuilderResource.cs (1)
10/// This uses a DCP executable resource rather than <see cref="System.Diagnostics.Process"/> directly
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
362StartedAt = new DateTimeOffset(Process.GetCurrentProcess().StartTime)
Cli\CliOrphanDetector.cs (3)
17return !Process.GetProcessById(pid).HasExited; 30var process = Process.GetProcessById(pid);
Dashboard\DashboardEventHandlers.cs (1)
100var mainModule = Process.GetCurrentProcess().MainModule;
Dcp\Process\ProcessUtil.cs (3)
22var process = new System.Diagnostics.Process() 137private readonly System.Diagnostics.Process _process; 141public ProcessDisposable(System.Diagnostics.Process process, Task processLifetimeTask, bool entireProcessTree)
src\Shared\BackchannelConstants.cs (2)
251using var process = Process.GetProcessById(pid);
Aspire.Hosting.Azure (3)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (3)
22var process = new System.Diagnostics.Process() 137private readonly System.Diagnostics.Process _process; 141public ProcessDisposable(System.Diagnostics.Process process, Task processLifetimeTask, bool entireProcessTree)
Aspire.Hosting.DevTunnels (1)
DevTunnelCli.cs (1)
237using var process = new Process
Aspire.Hosting.Docker (3)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (3)
22var process = new System.Diagnostics.Process() 137private readonly System.Diagnostics.Process _process; 141public ProcessDisposable(System.Diagnostics.Process process, Task processLifetimeTask, bool entireProcessTree)
Aspire.Hosting.JavaScript.Tests (4)
AddJavaScriptAppTests.cs (4)
136using var process = Process.Start(processStartInfo); 147using var cleanupProcess = Process.Start(new ProcessStartInfo
Aspire.Hosting.Maui (2)
Utilities\ProjectFileReader.cs (2)
70using var process = Process.Start(startInfo);
Aspire.Hosting.Python (2)
PythonVersionDetector.cs (2)
78using var process = Process.Start(startInfo);
Aspire.Hosting.Python.Tests (4)
AddPythonAppTests.cs (4)
316var createVirtualEnvironmentProcess = Process.Start(prepareVirtualEnvironmentStartInfo); 346var installRequirementsProcess = Process.Start(installRequirementsStartInfo);
Aspire.Hosting.RemoteHost (1)
OrphanDetector.cs (1)
26return !Process.GetProcessById(pid).HasExited;
Aspire.Hosting.Tests (6)
Cli\CliOrphanDetectorTests.cs (2)
238using var fakeCliProcess = Process.Start(psi);
MSBuildTests.cs (2)
226using var process = new Process(); 553using var process = new Process();
Utils\DockerUtils.cs (2)
19if (Process.Start("docker", $"volume rm {volumeName}") is { } process) 35if (Process.Start("docker", $"volume inspect {volumeName}") is { } process)
Aspire.Templates.Tests (5)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
26public Process? AppHostProcess { get; private set; }
tests\Shared\TemplatesTesting\TestExtensions.cs (2)
20public static bool TryGetHasExited(this Process process) 32public static void CloseAndKillProcessIfRunning(this Process process)
tests\Shared\TemplatesTesting\ToolCommand.cs (2)
19public Process? CurrentProcess { get; private set; } 208private Process CreateProcess(string executable, string args)
csc (5)
src\roslyn\src\Compilers\CSharp\csc\Program.cs (1)
31using var logger = new CompilerServerLogger($"csc {Process.GetCurrentProcess().Id}");
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (3)
133var process = Process.GetProcessById(shutdownBuildResponse.ServerProcessId); 642if (Process.Start(startInfo) is { } process)
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
126var processId = Process.GetCurrentProcess().Id;
datacollector (7)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (7)
60ConsoleOutput.Instance.WriteLine($"Attaching Visual Studio with PID {vsPid} to the process '{Process.GetCurrentProcess().ProcessName}({processId})'...", OutputLevel.Information); 63AttachVs(Process.GetCurrentProcess(), vsPid); 69private static bool AttachVs(Process process, int? vsPid) 90var attachVsProcess = Process.Start(vsAttachPath, $"{process.Id} {vsPid}"); 132var currentProcess = Process.GetCurrentProcess();
datacollector.arm64 (7)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (7)
60ConsoleOutput.Instance.WriteLine($"Attaching Visual Studio with PID {vsPid} to the process '{Process.GetCurrentProcess().ProcessName}({processId})'...", OutputLevel.Information); 63AttachVs(Process.GetCurrentProcess(), vsPid); 69private static bool AttachVs(Process process, int? vsPid) 90var attachVsProcess = Process.Start(vsAttachPath, $"{process.Id} {vsPid}"); 132var currentProcess = Process.GetCurrentProcess();
dotnet (13)
CommandFactory\CommandFactoryUsingResolver.cs (1)
118var _process = new Process
Commands\Clean\FileBasedAppArtifacts\CleanFileBasedAppArtifactsCommand.cs (1)
141Process.Start(startInfo);
Commands\Help\HelpCommand.cs (2)
45public static Process ConfigureProcess(string docUrl) 90var process = ConfigureProcess(docsLink);
Commands\Test\MTP\TestApplication.cs (2)
60using var process = Process.Start(processStartInfo)!;
Program.cs (3)
63?.SetStartTime(Process.GetCurrentProcess().StartTime) 64?.AddTag("process.pid", Process.GetCurrentProcess().Id) 75hostStartupActivity?.SetStartTime(Process.GetCurrentProcess().StartTime);
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.9.0-1.26302.118\contentFiles\cs\net11.0\BuildServerConnection.cs (3)
133var process = Process.GetProcessById(shutdownBuildResponse.ServerProcessId); 642if (Process.Start(startInfo) is { } process)
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.9.0-1.26302.118\contentFiles\cs\net11.0\CompilerServerLogger.cs (1)
126var processId = Process.GetCurrentProcess().Id;
dotnet-dev-certs (25)
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (12)
104using (var process = Process.Start(MacOSTrustCertificateCommandLine, MacOSTrustCertificateCommandLineArguments + tmpFile)) 159using var checkTrustProcess = Process.Start(new ProcessStartInfo( 214using var process = Process.Start(processInfo); 257using (var process = Process.Start(processInfo)) 288using var findCertificateProcess = Process.Start(new ProcessStartInfo( 358using (var process = Process.Start(processInfo))
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (12)
694using var process = Process.Start(startInfo)!; 717using var process = Process.Start(startInfo)!; 746using var process = Process.Start(startInfo)!; 770using var process = Process.Start(startInfo)!; 942using var process = Process.Start(processInfo); 986using var process = Process.Start(processInfo);
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
65var mainModuleFullPath = Process.GetCurrentProcess().MainModule?.FileName;
dotnet-format (8)
Utilities\ProcessRunner.cs (8)
11public Process Process { get; } 16public ProcessResult(Process process, int exitCode, ReadOnlyCollection<string> outputLines, ReadOnlyCollection<string> errorLines) 27public Process Process { get; } 33public ProcessInfo(Process process, ProcessStartInfo startInfo, Task<ProcessResult> result) 47Process.Start(file); 59Action<Process>? onProcessStartHandler = null, 70Action<Process>? onProcessStartHandler = null, 77var process = new Process();
dotnet-suggest (1)
SuggestionStore.cs (1)
38using (var process = new Process
dotnet-svcutil-lib (6)
Shared\Utilities\DebugUtils.cs (2)
42var process = Process.GetCurrentProcess();
Shared\Utilities\ProcessRunner.cs (2)
68using (var proc = new Process()) 150var exitCode = Path.GetFileName(processName) == Path.GetFileName(Process.GetCurrentProcess().MainModule.FileName) ? proc.ExitCode : -1;
Shared\Utilities\SafeLogger.cs (2)
25return $"[{Process.GetCurrentProcess().Id}.{startTime.Millisecond}] {message}"; 31return $"[{Process.GetCurrentProcess().Id}.{startTime.Millisecond}] Time elapsed: {DateTime.Now - startTime}";
dotnet-user-jwts (2)
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
65var mainModuleFullPath = Process.GetCurrentProcess().MainModule?.FileName;
src\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (1)
79using var process = new Process()
dotnet-user-secrets (2)
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
65var mainModuleFullPath = Process.GetCurrentProcess().MainModule?.FileName;
src\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (1)
79using var process = new Process()
Infrastructure.Tests (8)
ExtractTestPartitions\ExtractTestPartitionsFixture.cs (1)
32using var process = new Process { StartInfo = psi };
ExtractTestPartitions\ExtractTestPartitionsTests.cs (1)
313using var process = new Process { StartInfo = psi };
PowerShellScripts\PowerShellCommand.cs (4)
22public Process? CurrentProcess { get; private set; } 199private Process CreateProcess(string args) 304public static bool TryGetHasExited(this Process process) 316public static void CloseAndKillProcessIfRunning(this Process? process)
WorkflowScripts\NodeCommand.cs (2)
27public Process? CurrentProcess { get; private set; } 179private Process CreateProcess(string scriptPath, string[] args)
Microsoft.Agents.AI.ProjectTemplates.Tests (2)
test\ProjectTemplates\Infrastructure\ProcessExtensions.cs (1)
11public static bool TryGetHasExited(this Process process)
test\ProjectTemplates\Infrastructure\TestCommand.cs (1)
55using var process = new Process
Microsoft.Arcade.Common (1)
Command.cs (1)
18private readonly Process _process;
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
381 using (var launchBrowser = new Process())
Microsoft.AspNetCore.Components.WebView.Wpf (1)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
381 using (var launchBrowser = new Process())
Microsoft.AspNetCore.DeveloperCertificates.XPlat (24)
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (12)
104using (var process = Process.Start(MacOSTrustCertificateCommandLine, MacOSTrustCertificateCommandLineArguments + tmpFile)) 159using var checkTrustProcess = Process.Start(new ProcessStartInfo( 214using var process = Process.Start(processInfo); 257using (var process = Process.Start(processInfo)) 288using var findCertificateProcess = Process.Start(new ProcessStartInfo( 358using (var process = Process.Start(processInfo))
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (12)
694using var process = Process.Start(startInfo)!; 717using var process = Process.Start(startInfo)!; 746using var process = Process.Start(startInfo)!; 770using var process = Process.Start(startInfo)!; 942using var process = Process.Start(processInfo); 986using var process = Process.Start(processInfo);
Microsoft.AspNetCore.Server.Kestrel.Core (24)
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (12)
104using (var process = Process.Start(MacOSTrustCertificateCommandLine, MacOSTrustCertificateCommandLineArguments + tmpFile)) 159using var checkTrustProcess = Process.Start(new ProcessStartInfo( 214using var process = Process.Start(processInfo); 257using (var process = Process.Start(processInfo)) 288using var findCertificateProcess = Process.Start(new ProcessStartInfo( 358using (var process = Process.Start(processInfo))
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (12)
694using var process = Process.Start(startInfo)!; 717using var process = Process.Start(startInfo)!; 746using var process = Process.Start(startInfo)!; 770using var process = Process.Start(startInfo)!; 942using var process = Process.Start(processInfo); 986using var process = Process.Start(processInfo);
Microsoft.Build (55)
BackEnd\BuildManager\BuildManager.cs (6)
481private void UpdatePriority(Process p, ProcessPriorityClass priority) 509IEnumerable<Process>? processes = _nodeManager?.GetProcesses(); 512foreach (Process p in processes) 521foreach (Process p in processes) 895/// <returns>Enumeration of <see cref="Process"/> objects that were valid during the time of call to this function.</returns> 896public IEnumerable<Process> GetWorkerProcesses()
BackEnd\Client\MSBuildClient.cs (3)
478using Process msbuildProcess = nodeLauncher.Start(launchData, nodeId: 0); 695using Process launched = Process.GetProcessById(pid);
BackEnd\Components\Communications\INodeLauncher.cs (1)
38Process Start(NodeLaunchData launchData, int nodeId);
BackEnd\Components\Communications\INodeManager.cs (1)
56IEnumerable<Process> GetProcesses();
BackEnd\Components\Communications\INodeProvider.cs (1)
91IEnumerable<Process> GetProcesses();
BackEnd\Components\Communications\NodeLauncher.cs (7)
50public Process Start(NodeLaunchData launchData, int nodeId) 60private Process StartInternal(NodeLaunchData nodeLaunchData) 114private Process StartProcessUnix(NodeLaunchData nodeLaunchData, string exeName, bool redirectStreams, bool isNativeAppHost) 137Process process = Process.Start(processStartInfo); 324private static Process DisableMSBuildServer(Func<Process> func)
BackEnd\Components\Communications\NodeManager.cs (1)
350public IEnumerable<Process> GetProcesses()
BackEnd\Components\Communications\NodeProviderInProc.cs (1)
469public IEnumerable<Process> GetProcesses() => throw new NotImplementedException();
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (1)
212public IEnumerable<Process> GetProcesses()
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (27)
166List<Process> nodeProcesses = GetPossibleRunningNodes().nodeProcesses.ToList(); 172nodeProcesses.AddRange(Process.GetProcessesByName(Path.GetFileNameWithoutExtension(msbuildtaskhostExeName))); 175foreach (Process nodeProcess in nodeProcesses) 266ConcurrentQueue<Process> possibleRunningNodes = null; 271IList<Process> possibleRunningNodesList; 275possibleRunningNodes = new ConcurrentQueue<Process>(possibleRunningNodesList); 320while (possibleRunningNodes != null && possibleRunningNodes.TryDequeue(out var nodeToReuse)) 393Process msbuildProcess = nodeLauncher.Start(launchData, nodeId); 441void CreateNodeContext(int nodeId, Process nodeToReuse, Stream nodeStream, byte negotiatedVersion) 458private (string expectedProcessName, IList<Process> nodeProcesses) GetPossibleRunningNodes( 472List<Process> processes = new(); 477processes.AddRange(Process.GetProcessesByName(name)); 578private static IList<Process> FilterProcessesByNodeMode(List<Process> processes, NodeMode expectedNodeMode, string expectedProcessName) 582List<Process> filtered = new(capacity: processes.Count); 584foreach (Process process in processes) 725(_, IList<Process> nodeProcesses) = GetPossibleRunningNodes(nodeMode); 727foreach (var process in nodeProcesses) 740private static (string expectedProcessName, IList<Process> nodeProcesses) GetPossibleRunningNodes(NodeMode? expectedNodeMode) 744Process[] processes; 747processes = Process.GetProcessesByName(expectedProcessName); 751return (expectedProcessName, Array.Empty<Process>()); 756List<Process> filteredProcesses = []; 758foreach (var process in processes) 948private readonly Process _process; 950internal Process Process { get { return _process; } } 1030Process process,
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (1)
904public IEnumerable<Process> GetProcesses() => _nodeContexts.Values.Select(context => context.Process);
BackEnd\Components\Communications\TaskHostNodeManager.cs (1)
182IEnumerable<Process> INodeManager.GetProcesses()
BackEnd\Node\OutOfProcNode.cs (2)
872using Process currentProcess = Process.GetCurrentProcess();
Evaluation\ProjectRootElementCache.cs (1)
667Trace.WriteLine($"{prefix} {Process.GetCurrentProcess().Id} | {message}{param1}");
Instance\TaskFactories\TaskHostTask.cs (1)
389Process.GetCurrentProcess().Id,
Microsoft.Build.Framework (12)
BackEnd\Handshake.cs (2)
96using var currentProcess = Process.GetCurrentProcess();
EnvironmentUtilities.cs (2)
90using Process currentProcess = Process.GetCurrentProcess();
Telemetry\CrashTelemetry.cs (4)
455using var process = System.Diagnostics.Process.GetCurrentProcess(); 479using var process = System.Diagnostics.Process.GetCurrentProcess();
Utilities\ProcessExtensions.cs (4)
31public static void KillTree(this Process process, int timeoutMilliseconds) 70public static bool TryGetCommandLine(this Process? process, out string? commandLine) 91public static bool TryGetCommandLine(this Process? process, CommandLineSource source, out string? commandLine) 219/// Do not attempt to retrieve the command line. Default behavior; <see cref="TryGetCommandLine(Process?, out string?)"/>
Microsoft.Build.Tasks.CodeAnalysis (5)
src\roslyn\src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (1)
509using var innerLogger = new CompilerServerLogger($"MSBuild {Process.GetCurrentProcess().Id}");
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (3)
133var process = Process.GetProcessById(shutdownBuildResponse.ServerProcessId); 642if (Process.Start(startInfo) is { } process)
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
126var processId = Process.GetCurrentProcess().Id;
Microsoft.Build.Tasks.Core (2)
ManifestUtil\SecurityUtil.cs (2)
790Process signTool = null; 794signTool = Process.Start(startInfo);
Microsoft.Build.Utilities.Core (10)
ToolTask.cs (10)
365/// Overridable function called after <see cref="Process.Start()"/> in <see cref="ExecuteTool"/> 734/// <param name="proc">Fully populated <see cref="Process"/> instance representing the tool process to be started.</param> 735/// <returns>A started process. This could be <paramref name="proc"/> or another <see cref="Process"/> instance.</returns> 736protected virtual Process StartToolProcess(Process proc) 761Process proc = null; 935private void HandleToolNotifications(Process proc) 1034private void KillToolProcessOnTimeout(Process proc, bool isBeingCancelled) 1077private void TerminateToolProcess(Process proc, bool isBeingCancelled) 1115private void WaitForProcessExit(Process proc)
Microsoft.CodeAnalysis.VisualBasic (1)
CommandLine\VisualBasicCommandLineParser.vb (1)
458Dim processId = System.Diagnostics.Process.GetCurrentProcess().Id
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Host\PersistentStorage\IPersistentStorageConfiguration.cs (1)
52var fileName = Process.GetCurrentProcess().MainModule?.FileName;
Microsoft.CodeAnalysis.Workspaces.MSBuild (4)
MSBuild\BuildHostProcessManager.cs (4)
117var process = Process.Start(processStartInfo); 425private readonly Process _process; 437public BuildHostProcess(Process process, ILoggerFactory? loggerFactory)
Microsoft.Data.Analysis.Tests (2)
test\Microsoft.ML.TestFramework\BaseTestClass.cs (2)
81Process proc = Process.GetCurrentProcess();
Microsoft.Diagnostics.NETCore.Client (3)
DiagnosticsIpc\IpcTransport.cs (1)
488Process.GetProcessById(pid);
DiagnosticsServerRouter\DiagnosticsServerRouterFactory.cs (2)
428_tcpClientAddress = IpcTcpSocketEndPoint.NormalizeTcpIpEndPoint(string.IsNullOrEmpty(tcpClient) ? "127.0.0.1:" + string.Format("{0}", 56000 + (Process.GetCurrentProcess().Id % 1000)) : tcpClient); 1432_runtimeProcessId = (ulong)Process.GetCurrentProcess().Id;
Microsoft.DotNet.Arcade.Sdk (2)
src\InstallDotNetCore.cs (2)
157var process = Process.Start(new ProcessStartInfo()
Microsoft.DotNet.Cli.Utils (11)
Command.cs (3)
8public class Command(Process? process, bool trimTrailingNewlines = false, IDictionary<string, string?>? customEnvironmentVariables = null) : ICommand 10private readonly Process _process = process ?? throw new ArgumentNullException(nameof(process)); 28public CommandResult Execute(Action<Process>? processStarted)
Extensions\ProcessStartInfoExtensions.cs (2)
14var process = new Process 37var process = new Process
ProcessReaper.cs (6)
30private readonly Process _process; 34public WindowsProcessReaper(Process process) : base(process) 134public UnixProcessReaper(Process process) : base(process) 187/// <inheritdoc cref="ProcessReaper(Process)"/> 188public static ProcessReaper Create(Process process) 206private ProcessReaper(Process process)
Microsoft.DotNet.HotReload.Watch (14)
Browser\BrowserLauncher.cs (1)
100using var browserProcess = ProcessRunner.TryStartProcess(processSpec, logger);
Process\ProcessRunner.cs (9)
13private sealed class ProcessState(Process process) : IDisposable 15public Process Process { get; } = process; 137internal static Process? TryStartProcess(ProcessSpec processSpec, ILogger logger) 144var process = new Process 235private async ValueTask TerminateProcessAsync(Process process, ProcessSpec processSpec, ProcessState state, ILogger logger) 258private static async ValueTask<bool> WaitForExitAsync(Process process, ProcessState state, TimeSpan? timeout, ILogger logger) 321private static void TerminateProcess(Process process, ProcessState state, ILogger logger, bool force) 343private static void TerminateWindowsProcess(Process process, ProcessState state, ILogger logger, bool force) 370private static void TerminateUnixProcess(Process process, ProcessState state, ILogger logger, bool force)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\KestrelWebSocketServer.cs (2)
102using var process = Process.Start(dotnetPath, "dev-certs https --check --quiet");
UI\PhysicalConsole.cs (2)
64using var process = Process.GetProcessById(processId);
Microsoft.DotNet.MacOsPkg.Core (1)
ExecuteHelper.cs (1)
23using (Process process = new Process { StartInfo = processStartInfo })
Microsoft.DotNet.StrongName (4)
Signing.cs (2)
116var process = Process.Start(new ProcessStartInfo()
Verification.cs (2)
152var process = Process.Start(new ProcessStartInfo()
Microsoft.Extensions.AI.Evaluation.Console (1)
Commands\ReportCommand.cs (1)
151_ = Process.Start(
Microsoft.Extensions.AI.Templates.Tests (2)
test\ProjectTemplates\Infrastructure\ProcessExtensions.cs (1)
11public static bool TryGetHasExited(this Process process)
test\ProjectTemplates\Infrastructure\TestCommand.cs (1)
55using var process = new Process
Microsoft.Extensions.DataIngestion.MarkItDown (1)
MarkItDownReader.cs (1)
75using (Process process = new() { StartInfo = startInfo })
Microsoft.Extensions.DataIngestion.Tests (1)
Readers\MarkItDownConditionAttribute.cs (1)
36using Process process = new() { StartInfo = startInfo };
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Windows\Interop\ProcessInfo.cs (2)
16foreach (var process in Process.GetProcesses())
Microsoft.Extensions.Hosting.WindowsServices (3)
Internal\Win32.cs (2)
14internal static unsafe Process? GetParentProcess() 31return Process.GetProcessById(procEntry.th32ParentProcessID);
WindowsServiceHelpers.cs (1)
41var parent = Internal.Win32.GetParentProcess();
Microsoft.Extensions.Telemetry (1)
Enrichment\StaticProcessLogEnricher.cs (1)
27var pid = System.Diagnostics.Process.GetCurrentProcess().Id;
Microsoft.Extensions.Telemetry.Tests (1)
Enrichment\ProcessLogEnricherTests.cs (1)
17private readonly int _processId = System.Diagnostics.Process.GetCurrentProcess().Id;
Microsoft.McpServer.ProjectTemplates.Tests (2)
test\ProjectTemplates\Infrastructure\ProcessExtensions.cs (1)
11public static bool TryGetHasExited(this Process process)
test\ProjectTemplates\Infrastructure\TestCommand.cs (1)
55using var process = new Process
Microsoft.ML.AutoML (4)
AutoMLExperiment\IPerformanceMonitor.cs (4)
81_totalCpuProcessorTime = Process.GetCurrentProcess().TotalProcessorTime; 120using (var process = Process.GetCurrentProcess()) 122var currentCpuProcessorTime = Process.GetCurrentProcess().TotalProcessorTime;
Microsoft.ML.CodeGenerator (3)
Utils.cs (3)
195var proc = new System.Diagnostics.Process(); 221var proc = new System.Diagnostics.Process(); 242var proc = new System.Diagnostics.Process();
Microsoft.ML.Data (2)
Utilities\TimerScope.cs (2)
36long physicalMemoryUsageInMB = System.Diagnostics.Process.GetCurrentProcess().PeakWorkingSet64 / 1024 / 1024; 39long virtualMemoryUsageInMB = System.Diagnostics.Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024 / 1024;
Microsoft.ML.FastTree (3)
FastTree.cs (2)
452Process currentProcess = Process.GetCurrentProcess();
GamModelParameters.cs (1)
956System.Diagnostics.Process.Start(uri.AbsoluteUri + "content/GamViz/");
Microsoft.ML.Sweeper (1)
ConfigRunner.cs (1)
226var p = new System.Diagnostics.Process
Microsoft.ML.TestFramework (3)
BaseTestClass.cs (2)
81Process proc = Process.GetCurrentProcess();
CopyAction.cs (1)
47if (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "dotnet")
Microsoft.NET.Build.Containers (5)
LocalDaemons\DockerCli.cs (5)
112using Process? loadProcess = Process.Start(loadInfo) ?? 203Process proc = new() 667using var process = Process.Start(psi)!;
Microsoft.NET.HostModel (2)
HostModelUtils.cs (2)
34using (var p = Process.Start(psi))
Microsoft.NET.Sdk.Publish.Tasks (2)
Tasks\GenerateEFSQLScripts.cs (2)
79private Process? _runningProcess; 97Process? proc = null;
Microsoft.NET.Sdk.Razor.Tasks (2)
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerConnection.cs (2)
399var process = Process.Start(startInfo);
Microsoft.TemplateEngine.Cli (5)
IReporterExtensions.cs (1)
28internal static void WriteCommandOutput(this IReporter reporter, Process process)
PostActionProcessors\ChmodPostActionProcessor.cs (2)
42Process? commandResult = System.Diagnostics.Process.Start(new ProcessStartInfo
PostActionProcessors\ProcessStartPostActionProcessor.cs (2)
53Process? commandResult = System.Diagnostics.Process.Start(new ProcessStartInfo
Microsoft.TestPlatform.Build (4)
Tasks\VSTestTask.cs (4)
56var currentProcess = Process.GetCurrentProcess(); 87using var activeProcess = new Process { StartInfo = processInfo }; 101Process.GetProcessById(_activeProcessId).Kill();
Microsoft.TestPlatform.CrossPlatEngine (1)
EventHandlers\TestRequestHandler.cs (1)
112var currentProcessPath = Process.GetCurrentProcess().MainModule?.FileName;
Microsoft.TestPlatform.Extensions.BlameDataCollector (43)
BlameCollector.cs (2)
311var p = Process.GetProcessById(_testHostProcessId);
MiniDumpWriteDump.cs (1)
25public static void CollectDumpUsingMiniDumpWriteDump(Process process, string outputFile, MiniDumpTypeOption type)
NetClientHangDumper.cs (4)
22var process = Process.GetProcessById(processId); 59foreach (var p in bottomUpTree) 92foreach (var p in bottomUpTree)
ProcDumpDumper.cs (8)
37private Process? _procDumpProcess; 42private Process? _process; 118_process = Process.GetProcessById(processId); 148_procDumpProcess = (Process)_processHelper.LaunchProcess( 291var process = Process.GetProcessById(processId); 318var procDumpProcess = (Process)_processHelper.LaunchProcess(
ProcessCodeMethods.cs (12)
24public static void Suspend(this Process process) 44public static List<ProcessTreeNode> GetProcessTree(this Process process) 46var childProcesses = Process.GetProcesses() 51foreach (var c in childProcesses) 79internal static int GetParentPid(Process process) 90internal static int GetParentPidWindows(Process process) 111internal static int GetParentPidLinux(Process process) 133internal static int GetParentPidMacOs(Process process) 139Process ps = new(); 167private static void ResolveChildren(Process parent, List<ProcessTreeNode> acc, int level, int limit) 185private static bool IsChildCandidate(Process child, Process parent)
ProcessTreeNode.cs (2)
10public Process? Process { get; set; } 16public Process? ParentProcess { get; set; }
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (7)
60ConsoleOutput.Instance.WriteLine($"Attaching Visual Studio with PID {vsPid} to the process '{Process.GetCurrentProcess().ProcessName}({processId})'...", OutputLevel.Information); 63AttachVs(Process.GetCurrentProcess(), vsPid); 69private static bool AttachVs(Process process, int? vsPid) 90var attachVsProcess = Process.Start(vsAttachPath, $"{process.Id} {vsPid}"); 132var currentProcess = Process.GetCurrentProcess();
WindowsHangDumper.cs (7)
40var process = Process.GetProcessById(processId); 69foreach (var p in bottomUpTree) 83foreach (var p in bottomUpTree) 109internal static void CollectDump(IProcessHelper processHelper, Process process, string outputFile, DumpTypeOption type) 153var dumpMiniTool = (Process)new ProcessHelper().LaunchProcess(
Microsoft.TestPlatform.PlatformAbstractions (23)
common\System\ProcessHelper.cs (14)
24private readonly Process _currentProcess = Process.GetCurrentProcess(); 63var process = new Process(); 127process.OutputDataReceived += (sender, args) => outputCallBack(sender as Process, args.Data); 132process.ErrorDataReceived += (sender, args) => errorCallback(sender as Process, args.Data); 141if (sender is Process p) 255return Process.GetProcessById(processId).ProcessName; 263if (process is Process proc && proc.HasExited) 283var process = processId == _currentProcess.Id ? _currentProcess : Process.GetProcessById(processId); 300if (process is Process proc && !proc.HasExited) 314var proc = process as Process; 336if (process is Process proc && !proc.HasExited)
common\Tracing\PlatformEqtTrace.cs (6)
337using var process = Process.GetCurrentProcess(); 408using var process = Process.GetCurrentProcess(); 427using var process = Process.GetCurrentProcess();
net462\System\ProcessHelper.cs (2)
64var process = processId == _currentProcess.Id ? _currentProcess : Process.GetProcessById(processId);
netcore\System\ProcessHelper.cs (1)
29return Process.GetProcessById(processId).SafeHandle.DangerousGetHandle();
Microsoft.TestPlatform.TestHostRuntimeProvider (8)
Hosting\DefaultTestHostManager.cs (4)
65private Process? _testHostProcess; 553_createNoNewWindow) as Process; 558_testHostProcess = Process.GetProcessById(processId); 573internal static void AdjustProcessPriorityBasedOnSettings(Process testHostProcess, IDictionary<string, string?>? testHostEnvironmentVariables)
Hosting\DotnetTestHostManager.cs (3)
73private Process? _testHostProcess; 869_createNoNewWindow) as Process; 874_testHostProcess = Process.GetProcessById(processId);
Hosting\TestHostManagerCallbacks.cs (1)
90if (process is Process p)
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (3)
VsTestConsoleProcessManager.cs (3)
58private Process? _process; 167_process = Process.Start(info); 241ExitCode = ((Process)sender!).ExitCode;
MSBuild (4)
XMake.cs (4)
425using Process currentProcess = Process.GetCurrentProcess(); 2119using Process currentProcess = Process.GetCurrentProcess();
netstandard (1)
netstandard.cs (1)
665[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Process))]
NuGet.Build.Tasks (1)
StaticGraphRestoreTaskBase.cs (1)
117using (var process = new Process())
NuGet.CommandLine.XPlat (3)
Commands\Package\Update\PackageUpdateIO.cs (2)
122using var process = Process.Start(processStartInfo);
src\nuget-client\artifacts\.packages\microsoft.extensions.commandlineutils.sources\3.0.0-preview6.19253.5\contentFiles\cs\netstandard1.0\shared\Utilities\DotNetMuxer.cs (1)
47var mainModule = Process.GetCurrentProcess().MainModule;
NuGet.Common (3)
Migrations\Migration1.cs (1)
201using (var proc = new Process())
RuntimeEnvironmentHelper.cs (2)
70using (var process = Process.GetCurrentProcess())
NuGet.Credentials (3)
PluginCredentialProvider.cs (3)
257using var process = Process.Start(startInfo); 310private static void Kill(Process p)
NuGet.PackageManagement (1)
Utility\UriHelper.cs (1)
44Process.Start(url.AbsoluteUri);
NuGet.Packaging (1)
NuGetExtractionFileIO.cs (1)
108using (var process = new Process())
NuGet.Protocol (13)
Plugins\Logging\PluginLogger.cs (2)
103using (var process = Process.GetCurrentProcess())
Plugins\Logging\ProcessLogMessage.cs (2)
20using (var process = Process.GetCurrentProcess())
Plugins\PluginManager.cs (2)
380using (var process = Process.GetCurrentProcess())
Plugins\PluginProcess.cs (3)
21private readonly Process _process; 66_process = Process.GetCurrentProcess(); 166if (sender is Process process)
Plugins\RequestHandlers\MonitorNuGetProcessExitRequestHandler.cs (4)
21private readonly ConcurrentDictionary<int, Process> _processes; 38_processes = new ConcurrentDictionary<int, Process>(); 97Process process = null; 101process = _processes.GetOrAdd(monitorRequest.ProcessId, pid => Process.GetProcessById(pid));
Pipelines.AppHost (8)
AppHost.cs (8)
74var getUserProcess = System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo 109var getSubscriptionProcess = System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo 144var getResourceGroupProcess = System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo 182var assignRoleProcess = System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
Pipelines.Library (2)
DistributedApplicationPipelineExtensions.cs (2)
74var publishProcess = Process.Start(new ProcessStartInfo
PresentationUI (4)
InstallationError.xaml.cs (1)
211Process Notepad = new Process();
MS\Internal\Documents\RightsManagementProvider.cs (2)
1341System.Diagnostics.Process currentProcess = System.Diagnostics.Process.GetCurrentProcess();
TenFeetInstallationError.xaml.cs (1)
215Process Notepad = new Process();
RepoTasks (24)
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (12)
104using (var process = Process.Start(MacOSTrustCertificateCommandLine, MacOSTrustCertificateCommandLineArguments + tmpFile)) 159using var checkTrustProcess = Process.Start(new ProcessStartInfo( 214using var process = Process.Start(processInfo); 257using (var process = Process.Start(processInfo)) 288using var findCertificateProcess = Process.Start(new ProcessStartInfo( 358using (var process = Process.Start(processInfo))
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (12)
694using var process = Process.Start(startInfo)!; 717using var process = Process.Start(startInfo)!; 746using var process = Process.Start(startInfo)!; 770using var process = Process.Start(startInfo)!; 942using var process = Process.Start(processInfo); 986using var process = Process.Start(processInfo);
rzc (4)
ServerProtocol\ServerConnection.cs (2)
399var process = Process.Start(startInfo);
ShutdownCommand.cs (2)
59var process = Process.GetProcessById(response.ServerProcessId);
Stress.TelemetryService (4)
GaugeMetrics.cs (4)
15var process = Process.GetCurrentProcess(); 23var processes = Process.GetProcesses().ToList(); 25foreach (var process in processes)
SuperFileCheck (2)
Program.cs (2)
115using (var proc = Process.Start(startInfo))
System (1)
src\runtime\src\libraries\shims\System\ref\System.cs (1)
520[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Process))]
System.CodeDom (2)
System\CodeDom\Compiler\Executor.cs (2)
67using (Process p = Process.Start(psi))
System.Configuration.ConfigurationManager (2)
System\Configuration\ClientConfigPaths.cs (2)
75using (Process currentProcess = Process.GetCurrentProcess())
System.Diagnostics.PerformanceCounter (2)
System\Diagnostics\PerformanceCounterLib.cs (2)
1195Process p; 1212p = Process.Start(processStartInfo);
System.Diagnostics.Process (75)
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (1)
273filename = Process.GetPathToOpenFile();
System\Diagnostics\Process.cs (43)
91/// Initializes a new instance of the <see cref='System.Diagnostics.Process'/> class. 100if (GetType() == typeof(Process)) 468/// Gets or sets the properties to pass into the <see cref='System.Diagnostics.Process.Start(System.Diagnostics.ProcessStartInfo)'/> method for the <see cref='System.Diagnostics.Process'/>. 547/// Gets or sets whether the <see cref='System.Diagnostics.Process.Exited'/> 722/// Causes the <see cref="Process"/> component to wait the specified <paramref name="timeout"/> for the associated process to enter an idle state. 740/// No process is associated with this <see cref="Process"/> object. 907/// Returns a new <see cref='System.Diagnostics.Process'/> component given a process identifier and 911public static Process GetProcessById(int processId, string machineName) 924/// Returns a new <see cref='System.Diagnostics.Process'/> component given the 928public static Process GetProcessById(int processId) 941/// Creates an array of <see cref='System.Diagnostics.Process'/> components that are 950public static Process[] GetProcessesByName(string? processName) 960/// Creates an array of <see cref="Process"/> components that are associated with process resources on a 966public static Process[] GetProcessesByName(string? processName, string machineName) 977/// Creates a new <see cref='System.Diagnostics.Process'/> 984public static Process[] GetProcesses() 994/// Creates a new <see cref='System.Diagnostics.Process'/> 1002public static Process[] GetProcesses(string machineName) 1010private static Process[] CreateProcessArray(ArrayBuilder<ProcessInfo> processInfos, string machineName, bool isRemoteMachine) 1014Process[] processes = new Process[processInfos.Count]; 1027/// Returns a new <see cref='System.Diagnostics.Process'/> 1031public static Process GetCurrentProcess() 1038/// Raises the <see cref='System.Diagnostics.Process.Exited'/> event. 1079/// that has been cached inside the process component. After <see cref='System.Diagnostics.Process.Refresh'/> is called, the 1150/// Starts a process specified by the <see cref='System.Diagnostics.Process.StartInfo'/> property of this <see cref='System.Diagnostics.Process'/> 1152/// <see cref='System.Diagnostics.Process'/> . If a process resource is reused 1153/// rather than started, the reused process is associated with this <see cref='System.Diagnostics.Process'/> 1321/// document or application file. Associates the process resource with a new <see cref='System.Diagnostics.Process'/> 1328public static Process Start(string fileName) 1340/// with a new <see cref='System.Diagnostics.Process'/> 1347public static Process Start(string fileName, string? arguments) 1361public static Process Start(string fileName, IEnumerable<string> arguments) 1370/// Associates the process resource with a new <see cref='System.Diagnostics.Process'/> 1377public static Process? Start(ProcessStartInfo startInfo) 1381Process process = new Process(); 1445/// Instructs the <see cref='System.Diagnostics.Process'/> component to wait 1600/// Instructs the <see cref='System.Diagnostics.Process'/> component to start 1637/// Instructs the <see cref='System.Diagnostics.Process'/> component to start 1676/// Instructs the <see cref='System.Diagnostics.Process'/> component to cancel the asynchronous operation 1697/// Instructs the <see cref='System.Diagnostics.Process'/> component to cancel the asynchronous operation
System\Diagnostics\Process.Linux.cs (2)
88/// It is the sum of the <see cref='System.Diagnostics.Process.UserProcessorTime'/> and 89/// <see cref='System.Diagnostics.Process.PrivilegedProcessorTime'/>.
System\Diagnostics\Process.NonUap.cs (11)
35private bool IsSelfOrDescendantOf(Process processOfInterest) 40Process[] allProcesses = GetProcesses(); 44var descendantProcesses = new Queue<Process>(); 45Process? current = this; 49foreach (Process candidate in current.GetChildProcesses(allProcesses)) 60foreach (Process process in allProcesses) 72private List<Process> GetChildProcesses(Process[]? processes = null) 77List<Process> childProcesses = new List<Process>(); 79foreach (Process possibleChildProcess in processes)
System\Diagnostics\Process.Scenarios.cs (2)
214using Process process = Start(startInfo)!; 292using Process process = Start(startInfo)!;
System\Diagnostics\Process.Unix.cs (6)
39public static Process Start(string fileName, string userName, SecureString password, string domain) 46public static Process Start(string fileName, string arguments, string userName, SecureString password, string domain) 120List<Process> children = GetChildProcesses(); 133foreach (Process childProcess in children) 303private bool IsParentOf(Process possibleChildProcess) 315private bool Equals(Process process)
System\Diagnostics\ProcessManager.Linux.cs (4)
41return Process.GetUntruncatedProcessName(procPid, ref stat); 58if (modules is not null && Process.GetExePath(procPid) is string exePath) 93processName = Process.GetUntruncatedProcessName(procPid, ref stat); 114ProcessName = processName ?? Process.GetUntruncatedProcessName(procPid, ref procFsStat) ?? string.Empty,
System\Diagnostics\ProcessStartInfo.cs (1)
19/// used in conjunction with the <see cref='System.Diagnostics.Process'/>
System\Diagnostics\ProcessThread.Linux.cs (5)
44return Process.TicksToTimeSpan(stat.stime); 48private DateTime GetStartTime() => Process.BootTimeToDateTime(Process.TicksToTimeSpan(GetStat().starttime)); 63return Process.TicksToTimeSpan(stat.utime + stat.stime); 79return Process.TicksToTimeSpan(stat.utime);
System.Diagnostics.TextWriterTraceListener (2)
System\Diagnostics\XmlWriterTraceListener.cs (2)
259using Process process = Process.GetCurrentProcess();
System.Net.Ping (3)
System\Net\NetworkInformation\Ping.PingUtility.cs (3)
18private Process GetPingProcess(IPAddress address, byte[] buffer, int timeout, PingOptions? options) 53using (Process p = GetPingProcess(address, buffer, timeout, options)) 78using Process pingProcess = GetPingProcess(address, buffer, timeout, options);
System.Windows.Forms (3)
System\Windows\Forms\Application.cs (3)
1303Process process = Process.GetCurrentProcess(); 1329Process.Start(currentStartInfo);
testhost (7)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (7)
60ConsoleOutput.Instance.WriteLine($"Attaching Visual Studio with PID {vsPid} to the process '{Process.GetCurrentProcess().ProcessName}({processId})'...", OutputLevel.Information); 63AttachVs(Process.GetCurrentProcess(), vsPid); 69private static bool AttachVs(Process process, int? vsPid) 90var attachVsProcess = Process.Start(vsAttachPath, $"{process.Id} {vsPid}"); 132var currentProcess = Process.GetCurrentProcess();
testhost.arm64 (7)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (7)
60ConsoleOutput.Instance.WriteLine($"Attaching Visual Studio with PID {vsPid} to the process '{Process.GetCurrentProcess().ProcessName}({processId})'...", OutputLevel.Information); 63AttachVs(Process.GetCurrentProcess(), vsPid); 69private static bool AttachVs(Process process, int? vsPid) 90var attachVsProcess = Process.Start(vsAttachPath, $"{process.Id} {vsPid}"); 132var currentProcess = Process.GetCurrentProcess();
testhost.x86 (7)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (7)
60ConsoleOutput.Instance.WriteLine($"Attaching Visual Studio with PID {vsPid} to the process '{Process.GetCurrentProcess().ProcessName}({processId})'...", OutputLevel.Information); 63AttachVs(Process.GetCurrentProcess(), vsPid); 69private static bool AttachVs(Process process, int? vsPid) 90var attachVsProcess = Process.Start(vsAttachPath, $"{process.Id} {vsPid}"); 132var currentProcess = Process.GetCurrentProcess();
UIAutomationClient (2)
MS\Internal\Automation\HwndProxyElementProvider.cs (2)
429System.Diagnostics.Process targetProcess = null; 432targetProcess = System.Diagnostics.Process.GetProcessById( pid );
UIAutomationClientSideProviders (4)
MS\Internal\AutomationProxies\Misc.cs (1)
1815string processName = System.Diagnostics.Process.GetProcessById((int)processId).ProcessName;
MS\Internal\AutomationProxies\WinEventTracker.cs (3)
475return Misc.ProxyGetClassName(Process.GetProcessById(processId).MainWindowHandle).Equals("ConsoleWindowClass"); 494Process[] localByName = Process.GetProcessesByName("csrss");
vbc (5)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (3)
133var process = Process.GetProcessById(shutdownBuildResponse.ServerProcessId); 642if (Process.Start(startInfo) is { } process)
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
126var processId = Process.GetCurrentProcess().Id;
src\roslyn\src\Compilers\VisualBasic\vbc\Program.cs (1)
33using var logger = new CompilerServerLogger($"vbc {Process.GetCurrentProcess().Id}");
VBCSCompiler (6)
src\roslyn\src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (1)
70new ShutdownBuildResponse(Process.GetCurrentProcess().Id),
src\roslyn\src\Compilers\Server\VBCSCompiler\VBCSCompiler.cs (1)
22using var logger = new CompilerServerLogger($"VBCSCompiler {Process.GetCurrentProcess().Id}", options.LogFilePath);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (3)
133var process = Process.GetProcessById(shutdownBuildResponse.ServerProcessId); 642if (Process.Start(startInfo) is { } process)
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
126var processId = Process.GetCurrentProcess().Id;
vstest.console (8)
Processors\AeDebuggerArgumentProcessor.cs (1)
193is Process process)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (7)
60ConsoleOutput.Instance.WriteLine($"Attaching Visual Studio with PID {vsPid} to the process '{Process.GetCurrentProcess().ProcessName}({processId})'...", OutputLevel.Information); 63AttachVs(Process.GetCurrentProcess(), vsPid); 69private static bool AttachVs(Process process, int? vsPid) 90var attachVsProcess = Process.Start(vsAttachPath, $"{process.Id} {vsPid}"); 132var currentProcess = Process.GetCurrentProcess();
vstest.console.arm64 (8)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (7)
60ConsoleOutput.Instance.WriteLine($"Attaching Visual Studio with PID {vsPid} to the process '{Process.GetCurrentProcess().ProcessName}({processId})'...", OutputLevel.Information); 63AttachVs(Process.GetCurrentProcess(), vsPid); 69private static bool AttachVs(Process process, int? vsPid) 90var attachVsProcess = Process.Start(vsAttachPath, $"{process.Id} {vsPid}"); 132var currentProcess = Process.GetCurrentProcess();
src\vstest\src\vstest.console\Processors\AeDebuggerArgumentProcessor.cs (1)
193is Process process)