172 instantiations of Process
aspire (11)
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\DotNetSdkInstaller.cs (1)
41using var process = new Process { StartInfo = _createProcessStartInfo(dotnetPath, arguments) };
Git\GitRepository.cs (2)
37using var process = new Process { StartInfo = startInfo }; 123using var process = new Process { StartInfo = startInfo };
Npm\NpmRunner.cs (1)
293using var process = new Process { StartInfo = startInfo };
OpenCode\OpenCodeCliRunner.cs (1)
31using var process = new Process { StartInfo = startInfo };
Aspire.Acquisition.Tests (1)
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
228return new Process
Aspire.Cli.EndToEnd.Tests (4)
Helpers\KubernetesDeployTestHelpers.cs (2)
467using var kindProcess = new System.Diagnostics.Process(); 485using var registryProcess = new System.Diagnostics.Process();
KubernetesPublishTests.cs (1)
298using var cleanupProcess = new System.Diagnostics.Process();
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Cli.Tests (3)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Utils\GitTestHelper.cs (2)
15using var process = new Process { StartInfo = startInfo }; 39using var process = new Process { StartInfo = startInfo };
Aspire.Dashboard.Components.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Dashboard.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Deployment.EndToEnd.Tests (52)
AcaCompactNamingDeploymentTests.cs (1)
350var process = new System.Diagnostics.Process
AcaCompactNamingUpgradeDeploymentTests.cs (1)
400var process = new System.Diagnostics.Process
AcaCustomRegistryDeploymentTests.cs (1)
230var process = new System.Diagnostics.Process
AcaDeploymentErrorOutputTests.cs (1)
182var process = new System.Diagnostics.Process
AcaExistingRegistryDeploymentTests.cs (1)
266var process = new System.Diagnostics.Process
AcaManagedRedisDeploymentTests.cs (1)
267var process = new System.Diagnostics.Process
AcaStarterDeploymentTests.cs (1)
219var process = new System.Diagnostics.Process
AcrPurgeTaskDeploymentTests.cs (1)
263var process = new System.Diagnostics.Process
AksAzureKubernetesEnvironmentCertManagerDeploymentTests.cs (1)
362using var process = new System.Diagnostics.Process
AksAzureKubernetesEnvironmentCertManagerTypeScriptDeploymentTests.cs (1)
378using var process = new System.Diagnostics.Process
AksAzureKubernetesEnvironmentGatewayDeploymentTests.cs (1)
322using var process = new System.Diagnostics.Process
AksBlazorRedisDeploymentTests.cs (1)
252using var process = new System.Diagnostics.Process
AksMultipleNodePoolsDeploymentTests.cs (1)
262using var process = new System.Diagnostics.Process
AksPersistentVolumeDeploymentTests.cs (1)
458using var process = new System.Diagnostics.Process
AksStarterDeploymentTests.cs (1)
372var process = new System.Diagnostics.Process
AksStarterWithRedisHelmDeploymentTests.cs (1)
401var process = new System.Diagnostics.Process
AksVnetInfraDeploymentTests.cs (1)
206using var process = new System.Diagnostics.Process
AksVnetWithAzureResourcesDeploymentTests.cs (1)
355using var process = new System.Diagnostics.Process
AksWithAzureResourcesDeploymentTests.cs (1)
336using var process = new System.Diagnostics.Process
AksWithHelmChartDeploymentTests.cs (1)
271using var process = new System.Diagnostics.Process
AppServicePythonDeploymentTests.cs (1)
215var process = new System.Diagnostics.Process
AppServiceReactDeploymentTests.cs (1)
415using var process = new System.Diagnostics.Process
AppServiceStoragePrivateEndpointDeploymentTests.cs (1)
388using var process = new System.Diagnostics.Process
AzureAppConfigDeploymentTests.cs (1)
182var process = new System.Diagnostics.Process
AzureContainerRegistryDeploymentTests.cs (1)
165var process = new System.Diagnostics.Process
AzureEventHubsDeploymentTests.cs (1)
182var process = new System.Diagnostics.Process
AzureKeyVaultDeploymentTests.cs (1)
182var process = new System.Diagnostics.Process
AzureLogAnalyticsDeploymentTests.cs (1)
165var process = new System.Diagnostics.Process
AzureResourceScopeDeploymentTests.cs (1)
215var process = new System.Diagnostics.Process
AzureRoleAssignmentRunModeTests.cs (1)
244using var process = new System.Diagnostics.Process
AzureServiceBusDeploymentTests.cs (1)
184var process = new System.Diagnostics.Process
AzureStorageDeploymentTests.cs (1)
359var process = new System.Diagnostics.Process
AzureStorageRunModeTests.cs (1)
227using var process = new System.Diagnostics.Process
FoundryHostedAgentDeploymentTests.cs (1)
337var process = new System.Diagnostics.Process
FrontDoorDeploymentTests.cs (1)
234var process = new System.Diagnostics.Process
Helpers\DeploymentE2ETestHelpers.cs (1)
147using var process = new Process
KubernetesGatewayTlsDeploymentTests.cs (1)
474var process = new System.Diagnostics.Process
KubernetesHelmChartDeploymentTests.cs (1)
317using var process = new System.Diagnostics.Process
NspStorageKeyVaultDeploymentTests.cs (1)
346var process = new System.Diagnostics.Process
PythonFastApiDeploymentTests.cs (1)
217var process = new System.Diagnostics.Process
RadiusStarterDeploymentTests.cs (1)
637using var process = new System.Diagnostics.Process
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
TypeScriptAzureContainerAppJobDeploymentTests.cs (1)
162using var process = new System.Diagnostics.Process
TypeScriptExpressDeploymentTests.cs (1)
204var process = new System.Diagnostics.Process
TypeScriptJavaScriptHostingDeploymentTests.cs (1)
207using var process = new System.Diagnostics.Process
TypeScriptVnetSqlServerInfraDeploymentTests.cs (1)
272var process = new System.Diagnostics.Process
VnetKeyVaultConnectivityDeploymentTests.cs (1)
258var process = new System.Diagnostics.Process
VnetKeyVaultInfraDeploymentTests.cs (1)
193var process = new System.Diagnostics.Process
VnetSqlServerConnectivityDeploymentTests.cs (1)
325var process = new System.Diagnostics.Process
VnetSqlServerInfraDeploymentTests.cs (1)
194var process = new System.Diagnostics.Process
VnetStorageBlobConnectivityDeploymentTests.cs (1)
265var process = new System.Diagnostics.Process
VnetStorageBlobInfraDeploymentTests.cs (1)
195var 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)
40var process = new System.Diagnostics.Process()
Aspire.Hosting.Azure (1)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (1)
40var process = new System.Diagnostics.Process()
Aspire.Hosting.CodeGeneration.Rust.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Hosting.CodeGeneration.TypeScript.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Hosting.DevTunnels (1)
DevTunnelCli.cs (1)
238using var process = new Process
Aspire.Hosting.Docker (1)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (1)
40var process = new System.Diagnostics.Process()
Aspire.Hosting.Foundry (2)
FoundryLocalService.cs (2)
121var process = new Process 201using var process = new Process
Aspire.Hosting.Kubernetes (1)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (1)
40var process = new System.Diagnostics.Process()
Aspire.Hosting.Maui (1)
Lifecycle\MauiBuildQueueEventSubscriber.cs (1)
184using var process = new Process { StartInfo = psi };
Aspire.Hosting.Radius (5)
Publishing\RadCredentialRegisterStep.cs (1)
260using var process = new Process();
Publishing\RadiusDeploymentPipelineStep.cs (2)
52using var process = new Process(); 146using var process = new Process();
Publishing\SealedSecretApplyStep.cs (2)
832using var process = new Process 888using var process = new Process
Aspire.Hosting.RemoteHost.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Hosting.Rust (1)
CargoMetadataReader.cs (1)
84using var process = new Process { StartInfo = startInfo };
Aspire.Hosting.Sdk.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Hosting.Tasks (1)
RunAspireCliCommand.cs (1)
80using var process = new Process
Aspire.Hosting.Tests (2)
MSBuildTests.cs (2)
288using var process = new Process(); 1616using var process = new Process();
Aspire.Hosting.TestUtilities (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Managed.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using 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
Aspire.TerminalHost.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.TestTools (2)
GitHubCli.cs (2)
261using var process = new Process 311using var process = new Process
dotnet (2)
CommandFactory\CommandFactoryUsingResolver.cs (1)
118var _process = new Process
Commands\Help\HelpCommand.cs (1)
77return new Process
dotnet-aot (1)
src\sdk\src\Cli\dotnet\CommandFactory\CommandFactoryUsingResolver.cs (1)
118var _process = 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 (2)
src\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (2)
84using var process = new Process() 168using var process = new Process()
dotnet-user-secrets (2)
src\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (2)
84using var process = new Process() 168using var process = new Process()
Infrastructure.Tests (17)
CreateFailingTestIssue\CreateFailingTestIssueFixture.cs (1)
42using var process = new Process { StartInfo = processStartInfo };
CreateFailingTestIssue\CreateFailingTestIssueToolTests.cs (1)
647using var process = new Process { StartInfo = processStartInfo };
DownloadFailingJobLogs\DownloadFailingJobLogsToolTests.cs (1)
103using var process = new Process { StartInfo = processStartInfo };
ExtractTestPartitions\ExtractTestPartitionsFixture.cs (1)
32using var process = new Process { StartInfo = psi };
ExtractTestPartitions\ExtractTestPartitionsTests.cs (1)
314using var process = new Process { StartInfo = psi };
GenerateTestSummary\GenerateTestSummaryFixture.cs (1)
35using var process = new Process { StartInfo = processStartInfo };
GenerateTestSummary\GenerateTestSummaryToolTests.cs (1)
264using var process = new Process { StartInfo = processStartInfo };
Pipelines\NixCliPackageTests.cs (1)
222using var process = new System.Diagnostics.Process();
PowerShellScripts\PowerShellCommand.cs (1)
215return new Process
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
WorkflowScripts\ExtensionChangelogFinalizedWorkflowTests.cs (2)
318using var process = new Process(); 486using var process = new Process();
WorkflowScripts\ExtensionReleaseWorkflowTests.cs (4)
645using var process = new Process(); 728using var process = new Process(); 757using var process = new Process(); 831using var process = new Process();
WorkflowScripts\NodeCommand.cs (1)
200return new Process
Microsoft.Agents.AI.ProjectTemplates.Tests (1)
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.AspNetCore.Server.IntegrationTesting (6)
ApplicationPublisher.cs (1)
64var hostProcess = new Process() { StartInfo = startInfo };
Deployers\NginxDeployer.cs (3)
114using (var process = new Process 169using (var runNginx = new Process() { StartInfo = startInfo }) 211using (var runNginx = new Process() { StartInfo = startInfo })
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (1)
247using (var runScriptsOnRemoteServerProcess = new Process() { StartInfo = startInfo })
Deployers\SelfHostDeployer.cs (1)
145HostProcess = new Process() { StartInfo = startInfo };
Microsoft.Build.Utilities.Core (1)
ToolTask.cs (1)
782proc = 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)
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\MarkItDownConditionHelper.cs (1)
30using Process process = new() { StartInfo = startInfo };
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 (2)
LocalDaemons\ContainerRuntimes.cs (1)
141Process process = new()
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)
56var 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)
87_process = new Process();
PresentationUI (2)
InstallationError.xaml.cs (1)
211Process Notepad = new Process();
TenFeetInstallationError.xaml.cs (1)
215Process Notepad = new Process();
System.Diagnostics.Process (7)
System\Diagnostics\Process.cs (6)
1002return new Process(machineName, isRemoteMachine, processId, null); 1019return new Process(".", false, processId, null); 1038process = new Process(".", false, processId, null); 1126processes[i] = new Process(machineName, isRemoteMachine, processInfo.ProcessId, processInfo); 1141return new Process(".", false, Environment.ProcessId, null); 1567Process process = new Process();
System\Runtime\InteropServices\UnixProcessStartArguments.cs (1)
119Process process = new();
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.PingUtility.cs (1)
48return new Process() { StartInfo = psi };
1194 references to Process
aspire (133)
Acquisition\PeerInstallProbe.cs (3)
20/// Uses <see cref="Process"/> directly rather than the project's 22/// semantics await <see cref="Process.WaitForExitAsync(CancellationToken)"/> 327private static async Task<PeerProcessOutput> CapturePeerOutputAsync(Process process, CancellationToken cancellationToken)
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\CertificateProcessRunner.cs (2)
18using var process = Process.Start(startInfo) ?? throw new InvalidOperationException($"Failed to start process '{startInfo.FileName}'.");
Certificates\CertificateGeneration\MacOSCertificateManager.cs (2)
298using var findCertificateProcess = Process.Start(new ProcessStartInfo(
Certificates\CertificateHelpers.cs (2)
123using var process = Process.Start(processInfo);
Commands\AppHostFollowDisconnectHelpers.cs (2)
39using var process = Process.GetProcessById(pid);
Commands\UpdateCommand.cs (2)
928using var process = Process.Start(psi);
DotNet\DotNetSdkInstaller.cs (1)
41using var process = new Process { StartInfo = _createProcessStartInfo(dotnetPath, arguments) };
DotNet\ProcessExecution.cs (4)
255private Task ShutdownOnCancelAsync(Process process) 285private async Task ShutdownLadderAsync(Process process, IProcessTreeGracefulShutdownSignaler? signaler, CancellationToken gracefulToken) 382private void ForceKillChild(Process process) 462private static int GetSafePid(Process process)
Git\GitRepository.cs (5)
37using var process = new Process { StartInfo = startInfo }; 123using var process = new Process { StartInfo = startInfo }; 181private static CancellationTokenRegistration RegisterProcessKillOnCancellation(Process process, CancellationToken cancellationToken) 193var process = (Process)state!;
Npm\NpmRunner.cs (1)
293using var process = new Process { StartInfo = startInfo };
OpenCode\OpenCodeCliRunner.cs (1)
31using var process = new Process { StartInfo = startInfo };
Processes\IsolatedProcess.cs (26)
49/// is spawned via an ordinary redirected <see cref="Process.Start(ProcessStartInfo)"/> unless 103/// Mirrors the subset of <see cref="System.Diagnostics.Process"/> the CLI needs while compensating 113private Process? _process; 139/// <summary>The underlying <see cref="System.Diagnostics.Process"/> for escape-hatch scenarios.</summary> 140public Process Process => _process ?? throw new InvalidOperationException($"{nameof(IsolatedProcess)} has not been started."); 143/// The child's process id. Captured eagerly at spawn time because <see cref="Process.Id"/> 150/// <see cref="System.Diagnostics.Process"/> obtained from <see cref="Process.GetProcessById(int)"/> 159/// Mirrors <see cref="Process.HasExited"/>. The Windows spawn path overrides this with a 161/// because <see cref="Process.HasExited"/> on a <see cref="Process.GetProcessById(int)"/> 167/// Mirrors <see cref="Process.ExitCode"/>. The Windows spawn path overrides this with a 169/// override <see cref="Process.ExitCode"/> throws <see cref="InvalidOperationException"/> 170/// for processes obtained via <see cref="Process.GetProcessById(int)"/> on Windows. 189/// Starts asynchronous stdout line reads, matching <see cref="Process.BeginOutputReadLine"/>. 208/// Starts asynchronous stderr line reads, matching <see cref="Process.BeginErrorReadLine"/>. 237/// <summary>Mirrors <see cref="Process.WaitForExitAsync(CancellationToken)"/>.</summary> 240/// than the <see cref="Process.GetProcessById(int)"/> instance, whose 241/// <see cref="Process.WaitForExitAsync(CancellationToken)"/> can complete before the kernel marks 250/// Mirrors <see cref="Process.Kill(bool)"/>. 305/// Mirrors <see cref="Process.Start()"/> plus the launch knobs that require platform shims on the current target framework. 361/// Cross-platform redirected spawn: a thin <see cref="Process.Start(ProcessStartInfo)"/> wrapper. 395var process = Process.Start(psi) 442Process Process, 461private static DateTimeOffset? GetStartTime(Process process)
Processes\IsolatedProcess.Unix.cs (4)
47var dcpProcess = Process.Start(dcpStartInfo) 75Process? childProcess; 78childProcess = Process.GetProcessById(childPid);
Processes\IsolatedProcess.Windows.cs (4)
119var process = Process.GetProcessById(pi.dwProcessId); 232var process = Process.GetProcessById(pi.dwProcessId);
Processes\ProcessTreeGracefulShutdownService.cs (5)
236using var process = TryGetRunningProcess(target); 269using var process = TryGetRunningProcess(target); 348using var runningProcess = TryGetRunningProcess(process); 365private Process? TryGetRunningProcess(ProcessTarget target) 377using var process = TryGetRunningProcess(target);
Processes\WindowsProcessInterop.cs (4)
344/// it needs (e.g. obtained a managed <see cref="System.Diagnostics.Process"/> handle via 345/// <see cref="System.Diagnostics.Process.GetProcessById(int)"/>). 657/// <see cref="System.Diagnostics.Process.WaitForExitAsync(CancellationToken)"/> on a 658/// <see cref="System.Diagnostics.Process.GetProcessById(int)"/> instance is unreliable on
Program.cs (2)
1133var currentProcess = Process.GetCurrentProcess();
Projects\AppHostServerSession.cs (1)
116/// <see cref="System.Diagnostics.Process.GetProcessById(int)"/>); see
Projects\DotNetBasedAppHostServerProject.cs (2)
735using var process = Process.Start(startInfo);
Projects\IAppHostServerProject.cs (1)
37/// Windows spawn quirk (the underlying Process is obtained via <see cref="System.Diagnostics.Process.GetProcessById(int)"/>),
Projects\RunningInstanceManager.cs (2)
137var process = Process.GetProcessById(pid);
src\Aspire.Hosting\Backchannel\BackchannelDataTypes.cs (2)
1489/// Gets or sets when the AppHost process started using the legacy <see cref="Process.StartTime"/> clock domain. 1514/// <see cref="Process.StartTime"/> for released-AppHost compatibility. On Linux it drifts across
src\Shared\BackchannelConstants.cs (2)
415using var process = Process.GetProcessById(pid);
src\Shared\BundleVersionLease.cs (2)
265using var process = Process.GetCurrentProcess();
src\Shared\ContainerRuntimeDetector.cs (6)
152using var process = Process.Start(startInfo); 262using var process = Process.Start(startInfo); 339using var process = Process.Start(startInfo);
src\Shared\ProcessSignaler.cs (9)
16using var process = TryGetRunningProcess(pid, expectedStartTime, logger); 27using var process = TryGetRunningProcessWithRuntimeStartTime(pid, expectedStartTime, tolerance, logger); 52using var process = TryGetRunningProcess(pid, expectedStartTime, logger); 67public static Process? TryGetRunningProcess(int pid, DateTimeOffset? expectedStartTime, ILogger logger) 69Process? process = null; 72process = Process.GetProcessById(pid); 130public static Process? TryGetRunningProcessWithRuntimeStartTime(int pid, DateTimeOffset expectedStartTime, TimeSpan tolerance, ILogger logger) 132Process? process = null; 135process = Process.GetProcessById(pid);
src\Shared\ProcessStartTimeHelper.cs (17)
21/// The tolerance legacy callers apply when comparing a <see cref="Process.StartTime"/>-derived 48/// Gets the current process's start time as reported by <see cref="Process.StartTime"/>. 52using var process = Process.GetCurrentProcess(); 67using var process = Process.GetCurrentProcess(); 81/// using <see cref="Process.StartTime"/>. 88using var process = Process.GetProcessById(pid); 110using var process = Process.GetProcessById(pid); 168using var process = Process.GetProcessById(pid); 220/// <see cref="Process.StartTime"/>. Cross-process callers should pass a one-second 221/// <paramref name="tolerance"/> because on Linux <see cref="Process.StartTime"/> is reconstructed from 237using var process = Process.GetProcessById(pid);
Utils\CliDownloader.cs (2)
154using var process = Process.Start(psi);
Utils\EnvironmentChecker\DeprecatedWorkloadCheck.cs (4)
22private readonly Func<ProcessStartInfo, Process?> _startProcess = Process.Start; 24internal DeprecatedWorkloadCheck(ILogger<DeprecatedWorkloadCheck> logger, IEnvironment environment, Func<ProcessStartInfo, Process?> startProcess) 46using var process = _startProcess(processInfo);
Utils\ProcessCaptureRunner.cs (7)
24Func<Process, CancellationToken, Task<TCapture>> captureAsync, 34Process process; 37var started = Process.Start(startInfo); 170private static void TryKillProcessTree(Process process, ILogger logger) 185private static async Task SwallowExitWaitAsync(Process process, TimeSpan bound, ILogger logger) 208private static int TryGetPid(Process process)
aspire-managed (19)
src\Shared\BundleVersionLease.cs (2)
265using var process = Process.GetCurrentProcess();
src\Shared\ProcessStartTimeHelper.cs (17)
21/// The tolerance legacy callers apply when comparing a <see cref="Process.StartTime"/>-derived 48/// Gets the current process's start time as reported by <see cref="Process.StartTime"/>. 52using var process = Process.GetCurrentProcess(); 67using var process = Process.GetCurrentProcess(); 81/// using <see cref="Process.StartTime"/>. 88using var process = Process.GetProcessById(pid); 110using var process = Process.GetProcessById(pid); 168using var process = Process.GetProcessById(pid); 220/// <see cref="Process.StartTime"/>. Cross-process callers should pass a one-second 221/// <paramref name="tolerance"/> because on Linux <see cref="Process.StartTime"/> is reconstructed from 237using var process = Process.GetProcessById(pid);
Aspire.Acquisition.Tests (2)
tests\Shared\TemplatesTesting\ToolCommand.cs (2)
19public Process? CurrentProcess { get; private set; } 208private Process CreateProcess(string executable, string args)
Aspire.Cli.EndToEnd.Tests (8)
Helpers\CliE2ETestHelpers.cs (4)
456using var process = Process.Start(startInfo) ?? throw new InvalidOperationException("Failed to start docker build process."); 506using var process = Process.Start(startInfo) ?? throw new InvalidOperationException("Failed to start docker build process.");
Helpers\KubernetesDeployTestHelpers.cs (2)
467using var kindProcess = new System.Diagnostics.Process(); 485using var registryProcess = new System.Diagnostics.Process();
KubernetesPublishTests.cs (1)
298using var cleanupProcess = new System.Diagnostics.Process();
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Cli.Tests (77)
Acquisition\PeerInstallProbeTests.cs (4)
399using var process = await WaitForProcessIdAsync(pidFile, TestContext.Current.CancellationToken); 427private static async Task<Process> WaitForProcessIdAsync(string pidFile, CancellationToken cancellationToken) 436return Process.GetProcessById(pid); 444private static async Task WaitForExitAsync(Process process, CancellationToken cancellationToken)
Agents\TelemetryHookScriptTests.cs (2)
509using var process = Process.Start(psi)!;
Backchannel\OrphanedAppHostCollectorTests.cs (4)
145using var cliProcess = TestProcesses.StartLongRunning(); 173using var cliProcess = Process.Start(psi); 400private static DateTimeOffset GetProcessStartTime(Process process)
Commands\AppHostLauncherTests.cs (12)
631Process? startedProcess = null; 632Process? detachedHandle = null; 633Process? forkProcess = null; 636startedProcess = Process.Start(new ProcessStartInfo 644detachedHandle = Process.GetProcessById(startedProcess.Id); 646forkProcess = Process.Start(new ProcessStartInfo 787var startedProcess = harness.ProcessFactory.StartedProcess ?? throw new InvalidOperationException("Expected child process to start."); 1284public Process? StartedProcess { get; private set; } 1349StartedProcess = Process.Start(CreateProcessStartInfo(workingDirectory)) ?? throw new InvalidOperationException("Failed to start test child process."); 1463private sealed class MonitoredProcessExecutionAdapter(Process process, Process? exitMonitorProcess = null, DateTimeOffset? startTime = null, bool useSuppliedStartTime = false) : IProcessExecution 1519private static DateTimeOffset? GetStartTime(Process process)
Commands\RunCommandTests.cs (3)
471using var launcher = TestProcesses.StartLongRunning(); 568using var launcher = TestProcesses.StartLongRunning(); 4275private static long GetProcessStartTimeUnixMilliseconds(Process process)
DotNet\DotNetCliRunnerTests.cs (2)
2178using var process = Process.Start(processStartInfo) ?? throw new InvalidOperationException("Failed to start dotnet msbuild.");
Npm\AspireJsLauncherTests.cs (2)
377using var process = Process.Start(psi)!;
Processes\LauncherLivenessMonitorTests.cs (5)
31using var launcher = StartLongRunningProcess(); 77using var launcher = StartLongRunningProcess(); 95private static IConfiguration CreateLauncherConfiguration(Process launcher) 106private static Process StartLongRunningProcess() => TestProcesses.StartLongRunning(); 108private static long GetProcessStartTimeUnixMilliseconds(Process process)
Processes\ParentProcessLivenessMonitorTests.cs (6)
20using var parent = StartLongRunningProcess(); 46using var parent = StartLongRunningProcess(); 92using var parent = StartLongRunningProcess(); 118using var parent = StartLongRunningProcess(); 154private static Process StartLongRunningProcess() => TestProcesses.StartLongRunning(); 156private static long GetProcessStartTimeUnixMilliseconds(Process process)
Processes\ProcessTreeGracefulShutdownServiceTests.cs (12)
152using var appHostProcess = StartTerminatingShellProcess(); 208using var cliProcess = StartSignalIgnoringShellProcess(); 247using var cliProcess = StartSignalIgnoringShellProcess(); 286using var appHostProcess = StartTerminatingShellProcess(); 342private static Process StartSignalIgnoringShellProcess() 353var process = Process.Start(startInfo); 358private static Process StartTerminatingShellProcess() 369var process = Process.Start(startInfo); 374private static DateTimeOffset GetRuntimeProcessStartTime(Process process) 381private static async Task StopProcessAsync(Process process)
Processes\WindowsConsoleProcessJobTests.cs (4)
33using var spawnedProcess = SpawnJobAssignedChildProcess(job, createNewConsole: true); 55using var spawnedProcess = SpawnJobAssignedChildProcess(job, createNewConsole: false); 121private static Process SpawnJobAssignedChildProcess(WindowsConsoleProcessJob job, bool createNewConsole) 155return Process.GetProcessById(pi.dwProcessId);
Projects\AppHostServerSessionTests.cs (4)
227using var proc = Process.GetProcessById(pid); 504using var probe = Process.GetProcessById(pid);
Projects\ProcessGuestLauncherTests.cs (4)
106using var proc = Process.GetProcessById(pid); 159using var proc = Process.GetProcessById(pid);
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
tests\Shared\TestProcesses.cs (5)
23private static readonly ConcurrentDictionary<int, Process> s_tracked = new(); 32public static Process StartLongRunning() 45var process = Process.Start(psi) ?? throw new InvalidOperationException("Failed to start long-running test process."); 61foreach (var process in s_tracked.Values)
TestServices\ProcessTestHelpers.cs (4)
56using var probe = Process.GetProcessById(pid); 78using var process = Process.GetProcessById(pid);
Utils\GitTestHelper.cs (3)
15using var process = new Process { StartInfo = startInfo }; 39using var process = new Process { StartInfo = startInfo }; 51private static void StartProcessOrSkip(Process process)
Aspire.Dashboard.Components.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Dashboard.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Deployment.EndToEnd.Tests (52)
AcaCompactNamingDeploymentTests.cs (1)
350var process = new System.Diagnostics.Process
AcaCompactNamingUpgradeDeploymentTests.cs (1)
400var process = new System.Diagnostics.Process
AcaCustomRegistryDeploymentTests.cs (1)
230var process = new System.Diagnostics.Process
AcaDeploymentErrorOutputTests.cs (1)
182var process = new System.Diagnostics.Process
AcaExistingRegistryDeploymentTests.cs (1)
266var process = new System.Diagnostics.Process
AcaManagedRedisDeploymentTests.cs (1)
267var process = new System.Diagnostics.Process
AcaStarterDeploymentTests.cs (1)
219var process = new System.Diagnostics.Process
AcrPurgeTaskDeploymentTests.cs (1)
263var process = new System.Diagnostics.Process
AksAzureKubernetesEnvironmentCertManagerDeploymentTests.cs (1)
362using var process = new System.Diagnostics.Process
AksAzureKubernetesEnvironmentCertManagerTypeScriptDeploymentTests.cs (1)
378using var process = new System.Diagnostics.Process
AksAzureKubernetesEnvironmentGatewayDeploymentTests.cs (1)
322using var process = new System.Diagnostics.Process
AksBlazorRedisDeploymentTests.cs (1)
252using var process = new System.Diagnostics.Process
AksMultipleNodePoolsDeploymentTests.cs (1)
262using var process = new System.Diagnostics.Process
AksPersistentVolumeDeploymentTests.cs (1)
458using var process = new System.Diagnostics.Process
AksStarterDeploymentTests.cs (1)
372var process = new System.Diagnostics.Process
AksStarterWithRedisHelmDeploymentTests.cs (1)
401var process = new System.Diagnostics.Process
AksVnetInfraDeploymentTests.cs (1)
206using var process = new System.Diagnostics.Process
AksVnetWithAzureResourcesDeploymentTests.cs (1)
355using var process = new System.Diagnostics.Process
AksWithAzureResourcesDeploymentTests.cs (1)
336using var process = new System.Diagnostics.Process
AksWithHelmChartDeploymentTests.cs (1)
271using var process = new System.Diagnostics.Process
AppServicePythonDeploymentTests.cs (1)
215var process = new System.Diagnostics.Process
AppServiceReactDeploymentTests.cs (1)
415using var process = new System.Diagnostics.Process
AppServiceStoragePrivateEndpointDeploymentTests.cs (1)
388using var process = new System.Diagnostics.Process
AzureAppConfigDeploymentTests.cs (1)
182var process = new System.Diagnostics.Process
AzureContainerRegistryDeploymentTests.cs (1)
165var process = new System.Diagnostics.Process
AzureEventHubsDeploymentTests.cs (1)
182var process = new System.Diagnostics.Process
AzureKeyVaultDeploymentTests.cs (1)
182var process = new System.Diagnostics.Process
AzureLogAnalyticsDeploymentTests.cs (1)
165var process = new System.Diagnostics.Process
AzureResourceScopeDeploymentTests.cs (1)
215var process = new System.Diagnostics.Process
AzureRoleAssignmentRunModeTests.cs (1)
244using var process = new System.Diagnostics.Process
AzureServiceBusDeploymentTests.cs (1)
184var process = new System.Diagnostics.Process
AzureStorageDeploymentTests.cs (1)
359var process = new System.Diagnostics.Process
AzureStorageRunModeTests.cs (1)
227using var process = new System.Diagnostics.Process
FoundryHostedAgentDeploymentTests.cs (1)
337var process = new System.Diagnostics.Process
FrontDoorDeploymentTests.cs (1)
234var process = new System.Diagnostics.Process
Helpers\DeploymentE2ETestHelpers.cs (1)
147using var process = new Process
KubernetesGatewayTlsDeploymentTests.cs (1)
474var process = new System.Diagnostics.Process
KubernetesHelmChartDeploymentTests.cs (1)
317using var process = new System.Diagnostics.Process
NspStorageKeyVaultDeploymentTests.cs (1)
346var process = new System.Diagnostics.Process
PythonFastApiDeploymentTests.cs (1)
217var process = new System.Diagnostics.Process
RadiusStarterDeploymentTests.cs (1)
637using var process = new System.Diagnostics.Process
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
TypeScriptAzureContainerAppJobDeploymentTests.cs (1)
162using var process = new System.Diagnostics.Process
TypeScriptExpressDeploymentTests.cs (1)
204var process = new System.Diagnostics.Process
TypeScriptJavaScriptHostingDeploymentTests.cs (1)
207using var process = new System.Diagnostics.Process
TypeScriptVnetSqlServerInfraDeploymentTests.cs (1)
272var process = new System.Diagnostics.Process
VnetKeyVaultConnectivityDeploymentTests.cs (1)
258var process = new System.Diagnostics.Process
VnetKeyVaultInfraDeploymentTests.cs (1)
193var process = new System.Diagnostics.Process
VnetSqlServerConnectivityDeploymentTests.cs (1)
325var process = new System.Diagnostics.Process
VnetSqlServerInfraDeploymentTests.cs (1)
194var process = new System.Diagnostics.Process
VnetStorageBlobConnectivityDeploymentTests.cs (1)
265var process = new System.Diagnostics.Process
VnetStorageBlobInfraDeploymentTests.cs (1)
195var 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 (52)
ApplicationModel\ProjectRebuilderResource.cs (1)
10/// This uses a DCP executable resource rather than <see cref="System.Diagnostics.Process"/> directly
Backchannel\AuxiliaryBackchannelRpcTarget.cs (2)
891using var currentProcess = Process.GetCurrentProcess();
Backchannel\BackchannelDataTypes.cs (2)
1489/// Gets or sets when the AppHost process started using the legacy <see cref="Process.StartTime"/> clock domain. 1514/// <see cref="Process.StartTime"/> for released-AppHost compatibility. On Linux it drifts across
Cli\CliOrphanDetector.cs (1)
14using var process = ProcessSignaler.TryGetRunningProcess(pid, null, logger);
Dashboard\DashboardEventHandlers.cs (1)
97var mainModule = Process.GetCurrentProcess().MainModule;
Dcp\DcpProcessMonitor.cs (3)
4using SystemProcess = System.Diagnostics.Process; 12internal static DcpProcessIdentity GetMonitorProcessIdentity(SystemProcess parentProcess) 27private static DateTime? GetProcessIdentityTimestamp(SystemProcess parentProcess)
Dcp\Process\ProcessUtil.cs (4)
40var process = new System.Diagnostics.Process() 244private readonly System.Diagnostics.Process _process; 248public ProcessDisposable(System.Diagnostics.Process process, Task processLifetimeTask, bool entireProcessTree) 303private static void Kill(System.Diagnostics.Process process, bool entireProcessTree)
Diagnostics\ProfilingTelemetry.cs (1)
749return new DateTimeOffset(Process.GetCurrentProcess().StartTime.ToUniversalTime(), TimeSpan.Zero);
ResourceBuilderExtensions.cs (3)
24using SystemProcess = System.Diagnostics.Process; 176using var parentProcess = SystemProcess.GetProcessById(parentProcessId);
src\Shared\BackchannelConstants.cs (2)
415using var process = Process.GetProcessById(pid);
src\Shared\ContainerRuntimeDetector.cs (6)
152using var process = Process.Start(startInfo); 262using var process = Process.Start(startInfo); 339using var process = Process.Start(startInfo);
src\Shared\ProcessSignaler.cs (9)
16using var process = TryGetRunningProcess(pid, expectedStartTime, logger); 27using var process = TryGetRunningProcessWithRuntimeStartTime(pid, expectedStartTime, tolerance, logger); 52using var process = TryGetRunningProcess(pid, expectedStartTime, logger); 67public static Process? TryGetRunningProcess(int pid, DateTimeOffset? expectedStartTime, ILogger logger) 69Process? process = null; 72process = Process.GetProcessById(pid); 130public static Process? TryGetRunningProcessWithRuntimeStartTime(int pid, DateTimeOffset expectedStartTime, TimeSpan tolerance, ILogger logger) 132Process? process = null; 135process = Process.GetProcessById(pid);
src\Shared\ProcessStartTimeHelper.cs (17)
21/// The tolerance legacy callers apply when comparing a <see cref="Process.StartTime"/>-derived 48/// Gets the current process's start time as reported by <see cref="Process.StartTime"/>. 52using var process = Process.GetCurrentProcess(); 67using var process = Process.GetCurrentProcess(); 81/// using <see cref="Process.StartTime"/>. 88using var process = Process.GetProcessById(pid); 110using var process = Process.GetProcessById(pid); 168using var process = Process.GetProcessById(pid); 220/// <see cref="Process.StartTime"/>. Cross-process callers should pass a one-second 221/// <paramref name="tolerance"/> because on Linux <see cref="Process.StartTime"/> is reconstructed from 237using var process = Process.GetProcessById(pid);
Aspire.Hosting.Azure (4)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (4)
40var process = new System.Diagnostics.Process() 244private readonly System.Diagnostics.Process _process; 248public ProcessDisposable(System.Diagnostics.Process process, Task processLifetimeTask, bool entireProcessTree) 303private static void Kill(System.Diagnostics.Process process, bool entireProcessTree)
Aspire.Hosting.Browsers (4)
BrowserEndpointDiscovery.cs (2)
234using var process = Process.GetProcessById(processId);
BrowserLogsPipeBrowserProcessLauncher.Windows.cs (2)
249using var process = Process.GetProcessById(processId);
Aspire.Hosting.Browsers.Tests (4)
src\Aspire.Hosting.Browsers\BrowserEndpointDiscovery.cs (2)
234using var process = Process.GetProcessById(processId);
src\Aspire.Hosting.Browsers\BrowserLogsPipeBrowserProcessLauncher.Windows.cs (2)
249using var process = Process.GetProcessById(processId);
Aspire.Hosting.CodeGeneration.Python (2)
PythonLanguageSupport.cs (2)
280using var process = Process.Start(startInfo);
Aspire.Hosting.CodeGeneration.Rust.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Hosting.CodeGeneration.TypeScript.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Hosting.DevTunnels (1)
DevTunnelCli.cs (1)
238using var process = new Process
Aspire.Hosting.Docker (4)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (4)
40var process = new System.Diagnostics.Process() 244private readonly System.Diagnostics.Process _process; 248public ProcessDisposable(System.Diagnostics.Process process, Task processLifetimeTask, bool entireProcessTree) 303private static void Kill(System.Diagnostics.Process process, bool entireProcessTree)
Aspire.Hosting.EntityFrameworkCore (2)
EFResourceBuilderExtensions.cs (2)
412Process? process = null; 480process = Process.Start(startInfo);
Aspire.Hosting.Foundry (7)
FoundryLocalService.cs (7)
22private static Process? s_serviceProcess; 80Process? process; 121var process = new Process 169var (source, foundryProcess, timeoutToken) = ((TaskCompletionSource<Uri>, Process, CancellationToken))state!; 201using var process = new Process 211using var cancellationRegistration = cancellationToken.Register(static state => KillProcess((Process)state!), process); 343private static void KillProcess(Process process)
Aspire.Hosting.Java.Tests (8)
AddJavaAppPublishTests.cs (6)
57using var process = Process.Start(new ProcessStartInfo("sh") 1325using var process = Process.Start(new ProcessStartInfo 1489using var process = Process.Start(new ProcessStartInfo("/bin/sh")
AddJavaAppTests.cs (2)
826using var process = Process.Start(new ProcessStartInfo(app.Resource.Command)
Aspire.Hosting.JavaScript.Tests (6)
AddJavaScriptAppTests.cs (6)
595using var process = Process.Start(processStartInfo); 606using var cleanupProcess = Process.Start(new ProcessStartInfo 702using var process = Process.Start(processStartInfo);
Aspire.Hosting.Kubernetes (4)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (4)
40var process = new System.Diagnostics.Process() 244private readonly System.Diagnostics.Process _process; 248public ProcessDisposable(System.Diagnostics.Process process, Task processLifetimeTask, bool entireProcessTree) 303private static void Kill(System.Diagnostics.Process process, bool entireProcessTree)
Aspire.Hosting.Maui (4)
Lifecycle\MauiBuildQueueEventSubscriber.cs (2)
184using var process = new Process { StartInfo = psi }; 249private static void TryKillProcess(Process process, ILogger logger)
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.Radius (5)
Publishing\RadCredentialRegisterStep.cs (1)
260using var process = new Process();
Publishing\RadiusDeploymentPipelineStep.cs (2)
52using var process = new Process(); 146using var process = new Process();
Publishing\SealedSecretApplyStep.cs (2)
832using var process = new Process 888using var process = new Process
Aspire.Hosting.RemoteHost (17)
src\Shared\ProcessStartTimeHelper.cs (17)
21/// The tolerance legacy callers apply when comparing a <see cref="Process.StartTime"/>-derived 48/// Gets the current process's start time as reported by <see cref="Process.StartTime"/>. 52using var process = Process.GetCurrentProcess(); 67using var process = Process.GetCurrentProcess(); 81/// using <see cref="Process.StartTime"/>. 88using var process = Process.GetProcessById(pid); 110using var process = Process.GetProcessById(pid); 168using var process = Process.GetProcessById(pid); 220/// <see cref="Process.StartTime"/>. Cross-process callers should pass a one-second 221/// <paramref name="tolerance"/> because on Linux <see cref="Process.StartTime"/> is reconstructed from 237using var process = Process.GetProcessById(pid);
Aspire.Hosting.RemoteHost.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Hosting.Rust (2)
CargoMetadataReader.cs (2)
84using var process = new Process { StartInfo = startInfo }; 217private static void TryKillProcess(Process process)
Aspire.Hosting.Rust.Tests (2)
RustDockerfileShellTests.cs (2)
219using var process = Process.Start(startInfo) ?? throw new InvalidOperationException("Failed to start /bin/sh.");
Aspire.Hosting.Sdk.Tests (11)
AppHostSdkTargetsTests.cs (10)
835using var survivingChild = TryGetProcessById(childProcessId.Value); 843using var childProcess = TryGetProcessById(processId); 891using var survivingProcess = TryGetProcessById(processId.Value); 905using var process = TryGetProcessById(startedProcessId); 1814using var process = Process.Start(new ProcessStartInfo("dotnet", arguments) 1880using var process = Process.Start(startInfo); 1902private static Process? TryGetProcessById(int processId) 1906return Process.GetProcessById(processId);
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Hosting.Tasks (5)
ResolveAspireCliInvocation.cs (2)
160using var process = Process.Start(startInfo);
RunAspireCliCommand.cs (3)
63internal Func<Process, bool>? TestTerminateProcess { get; set; } 80using var process = new Process 174private bool TerminateProcess(Process process)
Aspire.Hosting.Tests (25)
Cli\CliOrphanDetectorTests.cs (1)
262using var fakeCliProcess = TestProcesses.StartLongRunning();
Cli\ProcessSignalerTests.cs (6)
17var currentProcess = Process.GetCurrentProcess(); 24using var result = ProcessSignaler.TryGetRunningProcess( 36var currentProcess = Process.GetCurrentProcess(); 44using var result = ProcessSignaler.TryGetRunningProcess(
Cli\ProcessStartTimeHelperTests.cs (1)
35using var process = TestProcesses.StartLongRunning();
Dcp\DcpExecutorTests.cs (2)
5245using var parentProcess = Process.GetCurrentProcess();
DistributedApplicationTests.cs (5)
2029using var parentProcess = Process.GetCurrentProcess(); 2093using var parentProcess = StartLongRunningProcess(); 2383private static Process StartLongRunningProcess() => TestProcesses.StartLongRunning(); 2385private static async Task KillProcessAsync(Process process, CancellationToken cancellationToken)
MSBuildTests.cs (2)
288using var process = new Process(); 1616using var process = new Process();
ResourceBuilderLifetimeTests.cs (2)
96using var parentProcess = Process.GetCurrentProcess();
tests\Shared\TestProcesses.cs (5)
23private static readonly ConcurrentDictionary<int, Process> s_tracked = new(); 32public static Process StartLongRunning() 45var process = Process.Start(psi) ?? throw new InvalidOperationException("Failed to start long-running test process."); 61foreach (var process in s_tracked.Values)
WithTerminalTests.cs (1)
492using var liveProcess = TestProcesses.StartLongRunning();
Aspire.Hosting.TestUtilities (3)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Utils\DockerUtils.cs (2)
119if (Process.Start(runtime, $"volume rm {volumeName}") is { } process) 135if (Process.Start(runtime, $"volume inspect {volumeName}") is { } process)
Aspire.Managed.Tests (7)
TerminalHostSignalTests.cs (6)
41using var process = Process.Start(startInfo) 107using var parentProcess = Process.Start( 138using var process = Process.Start(startInfo)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.Playground.Tests (2)
tests\Aspire.TestUtilities\TestcontainersPodmanConfiguration.cs (2)
252using var process = Process.Start(startInfo);
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)
Aspire.TerminalHost (17)
src\Shared\ProcessStartTimeHelper.cs (17)
21/// The tolerance legacy callers apply when comparing a <see cref="Process.StartTime"/>-derived 48/// Gets the current process's start time as reported by <see cref="Process.StartTime"/>. 52using var process = Process.GetCurrentProcess(); 67using var process = Process.GetCurrentProcess(); 81/// using <see cref="Process.StartTime"/>. 88using var process = Process.GetProcessById(pid); 110using var process = Process.GetProcessById(pid); 168using var process = Process.GetProcessById(pid); 220/// <see cref="Process.StartTime"/>. Cross-process callers should pass a one-second 221/// <paramref name="tolerance"/> because on Linux <see cref="Process.StartTime"/> is reconstructed from 237using var process = Process.GetProcessById(pid);
Aspire.TerminalHost.Tests (1)
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
Aspire.TestTools (2)
GitHubCli.cs (2)
261using var process = new Process 311using var process = new Process
Aspire.TestUtilities (4)
ProcessExtensions.cs (2)
14public static bool TryGetHasExited(this Process process) 26public static void CloseAndKillProcessIfRunning(this Process? process)
TestcontainersPodmanConfiguration.cs (2)
252using var process = Process.Start(startInfo);
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)
169using var process = Process.GetProcessById(serverProcessId); 651if (Process.Start(startInfo) is { } process)
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
125var 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 (17)
CommandFactory\CommandFactoryUsingResolver.cs (1)
118var _process = new Process
Commands\Clean\FileBasedAppArtifacts\CleanFileBasedAppArtifactsCommand.cs (1)
138_ = Process.StartAndForget(startInfo);
Commands\Help\HelpCommand.cs (2)
45public static Process ConfigureProcess(string docUrl) 90var process = ConfigureProcess(docsLink);
Commands\Test\MTP\CtrlCCancellationManager.cs (5)
34private readonly ConcurrentDictionary<Process, byte> _processes = new(); 64public void Register(Process process) 76public void Unregister(Process process) 135foreach (var process in _processes.Keys) 144private static void TryKill(Process process)
Commands\Test\MTP\TestApplication.cs (2)
102Process? process = null; 108process = Process.Start(processStartInfo)!;
Program.cs (2)
46?.SetStartTime(Process.GetCurrentProcess().StartTime) 47?.AddTag("process.pid", Process.GetCurrentProcess().Id)
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.12.0-1.26427.102\contentFiles\cs\net11.0\BuildServerConnection.cs (3)
169using var process = Process.GetProcessById(serverProcessId); 651if (Process.Start(startInfo) is { } process)
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.12.0-1.26427.102\contentFiles\cs\net11.0\CompilerServerLogger.cs (1)
125var processId = Process.GetCurrentProcess().Id;
dotnet-aot (3)
NativeEntryPoint.cs (2)
141mainActivity.SetStartTime(Process.GetCurrentProcess().StartTime.ToUniversalTime()); 142mainActivity.AddTag("process.pid", Process.GetCurrentProcess().Id);
src\sdk\src\Cli\dotnet\CommandFactory\CommandFactoryUsingResolver.cs (1)
118var _process = new Process
dotnet-dev-certs (14)
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (7)
106var exitStatus = Process.Run(new ProcessStartInfo(MacOSTrustCertificateCommandLine, MacOSTrustCertificateCommandLineArguments + tmpFile)); 170var checkTrustProcessOutput = Process.Run(checkTrustProcessStartInfo); 216var processExitStatus = Process.Run(processInfo); 257var processOutput = Process.RunAndCaptureText(processInfo); 284using var findCertificateProcess = Process.Start(new ProcessStartInfo( 354var processOutput = Process.RunAndCaptureText(processInfo);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (6)
696return Process.Run(startInfo).ExitCode == 0; 718return Process.Run(startInfo).ExitCode == 0; 746return Process.Run(startInfo).ExitCode == 0; 769if (Process.Run(startInfo).ExitCode == 0) 939var processOutput = Process.RunAndCaptureText(processInfo); 981var processOutput = Process.RunAndCaptureText(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-getdocument (3)
Exe.cs (2)
39using var process = Process.Start(startInfo);
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
65var mainModuleFullPath = Process.GetCurrentProcess().MainModule?.FileName;
dotnet-openapi (3)
Commands\BaseCommand.cs (2)
230using var process = Process.Start(startInfo);
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
65var mainModuleFullPath = Process.GetCurrentProcess().MainModule?.FileName;
dotnet-sql-cache (1)
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
65var mainModuleFullPath = Process.GetCurrentProcess().MainModule?.FileName;
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 (3)
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
65var mainModuleFullPath = Process.GetCurrentProcess().MainModule?.FileName;
src\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (2)
84using var process = new Process() 168using var process = new Process()
dotnet-user-secrets (3)
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
65var mainModuleFullPath = Process.GetCurrentProcess().MainModule?.FileName;
src\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (2)
84using var process = new Process() 168using var process = new Process()
GetDocument.Insider (1)
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
65var mainModuleFullPath = Process.GetCurrentProcess().MainModule?.FileName;
Infrastructure.Tests (27)
CreateFailingTestIssue\CreateFailingTestIssueFixture.cs (1)
42using var process = new Process { StartInfo = processStartInfo };
CreateFailingTestIssue\CreateFailingTestIssueToolTests.cs (1)
647using var process = new Process { StartInfo = processStartInfo };
DownloadFailingJobLogs\DownloadFailingJobLogsToolTests.cs (1)
103using var process = new Process { StartInfo = processStartInfo };
ExtractTestPartitions\ExtractTestPartitionsFixture.cs (1)
32using var process = new Process { StartInfo = psi };
ExtractTestPartitions\ExtractTestPartitionsTests.cs (1)
314using var process = new Process { StartInfo = psi };
GenerateTestSummary\GenerateTestSummaryFixture.cs (1)
35using var process = new Process { StartInfo = processStartInfo };
GenerateTestSummary\GenerateTestSummaryToolTests.cs (1)
264using var process = new Process { StartInfo = processStartInfo };
Pipelines\NixCliPackageTests.cs (1)
222using var process = new System.Diagnostics.Process();
PowerShellScripts\PowerShellCommand.cs (2)
23public Process? CurrentProcess { get; private set; } 200private Process CreateProcess(string args)
Shared\GitCli.cs (2)
39using var process = Process.Start(psi) ?? throw new InvalidOperationException("Failed to start git.");
tests\Shared\TemporaryWorkspace.cs (1)
31using var process = new Process
tools\GenerateCITimeline\GitHubApi.cs (2)
17using var process = Process.Start(psi) ?? throw new InvalidOperationException("Failed to start gh process.");
WorkflowScripts\ExtensionChangelogFinalizedWorkflowTests.cs (2)
318using var process = new Process(); 486using var process = new Process();
WorkflowScripts\ExtensionReleaseWorkflowTests.cs (6)
607using var process = Process.Start(startInfo) 645using var process = new Process(); 728using var process = new Process(); 757using var process = new Process(); 831using var process = new Process();
WorkflowScripts\NodeCommand.cs (2)
28public Process? CurrentProcess { get; private set; } 180private Process CreateProcess(string scriptPath, string[] args)
WorkflowScripts\PrDocsCheckWorkflowTests.cs (2)
189using var process = Process.Start(startInfo)
Microsoft.Agents.AI.ProjectTemplates.Tests (2)
ProcessExtensions.cs (1)
11public static bool TryGetHasExited(this Process process)
TestCommand.cs (1)
55using var process = new Process
Microsoft.Arcade.Common (1)
Command.cs (1)
18private readonly Process _process;
Microsoft.AspNetCore.Components.Testing (4)
Infrastructure\ParentProcessWatcher.cs (2)
33var parent = Process.GetProcessById(_parentPid);
Infrastructure\ServerInstance.cs (2)
26private Process? _process; 95_process = Process.Start(startInfo)
Microsoft.AspNetCore.Components.WebAssembly.Server (5)
DebugProxyLauncher.cs (4)
77var debugProxyProcess = Process.Start(processStartInfo); 139private static void PassThroughConsoleOutput(Process process) 165private static void CompleteTaskWhenServerIsReady(Process aspNetProcess, bool isFirefox, TaskCompletionSource<string> taskCompletionSource)
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
65var mainModuleFullPath = Process.GetCurrentProcess().MainModule?.FileName;
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 (13)
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (7)
106var exitStatus = Process.Run(new ProcessStartInfo(MacOSTrustCertificateCommandLine, MacOSTrustCertificateCommandLineArguments + tmpFile)); 170var checkTrustProcessOutput = Process.Run(checkTrustProcessStartInfo); 216var processExitStatus = Process.Run(processInfo); 257var processOutput = Process.RunAndCaptureText(processInfo); 284using var findCertificateProcess = Process.Start(new ProcessStartInfo( 354var processOutput = Process.RunAndCaptureText(processInfo);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (6)
696return Process.Run(startInfo).ExitCode == 0; 718return Process.Run(startInfo).ExitCode == 0; 746return Process.Run(startInfo).ExitCode == 0; 769if (Process.Run(startInfo).ExitCode == 0) 939var processOutput = Process.RunAndCaptureText(processInfo); 981var processOutput = Process.RunAndCaptureText(processInfo);
Microsoft.AspNetCore.InternalTesting (4)
CollectDumpAttribute.cs (2)
31var process = Process.GetCurrentProcess();
DumpCollector\DumpCollector.cs (1)
11public static void Collect(Process process, string fileName)
DumpCollector\DumpCollector.Windows.cs (1)
16internal static void Collect(Process process, string outputFile)
Microsoft.AspNetCore.Server.IntegrationTesting (17)
ApplicationPublisher.cs (1)
64var hostProcess = new Process() { StartInfo = startInfo };
Common\ProcessLoggingExtensions.cs (1)
10public static void StartAndCaptureOutAndErrToLogger(this Process process, string prefix, ILogger logger)
Deployers\ApplicationDeployer.cs (1)
115protected void ShutDownIfAnyHostProcess(Process hostProcess)
Deployers\NginxDeployer.cs (3)
114using (var process = new Process 169using (var runNginx = new Process() { StartInfo = startInfo }) 211using (var runNginx = new Process() { StartInfo = startInfo })
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (1)
247using (var runScriptsOnRemoteServerProcess = new Process() { StartInfo = startInfo })
Deployers\SelfHostDeployer.cs (1)
20public Process HostProcess { get; private set; }
src\aspnetcore\src\Shared\Process\ProcessEx.cs (5)
25private readonly Process _process; 36public ProcessEx(ITestOutputHelper output, Process proc, TimeSpan timeout) 69public Process Process => _process; 130var proc = Process.Start(startInfo);
src\aspnetcore\src\Shared\Process\ProcessExtensions.cs (4)
16public static void KillTree(this Process process) => process.KillTree(_defaultTimeout); 18public static void KillTree(this Process process, TimeSpan timeout) 106var process = Process.Start(startInfo);
Microsoft.AspNetCore.Server.Kestrel.Core (13)
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (7)
106var exitStatus = Process.Run(new ProcessStartInfo(MacOSTrustCertificateCommandLine, MacOSTrustCertificateCommandLineArguments + tmpFile)); 170var checkTrustProcessOutput = Process.Run(checkTrustProcessStartInfo); 216var processExitStatus = Process.Run(processInfo); 257var processOutput = Process.RunAndCaptureText(processInfo); 284using var findCertificateProcess = Process.Start(new ProcessStartInfo( 354var processOutput = Process.RunAndCaptureText(processInfo);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (6)
696return Process.Run(startInfo).ExitCode == 0; 718return Process.Run(startInfo).ExitCode == 0; 746return Process.Run(startInfo).ExitCode == 0; 769if (Process.Run(startInfo).ExitCode == 0) 939var processOutput = Process.RunAndCaptureText(processInfo); 981var processOutput = Process.RunAndCaptureText(processInfo);
Microsoft.AspNetCore.SpaProxy (6)
SpaProxyLaunchManager.cs (6)
19private Process? _spaProcess; 199_spaProcess = Process.Start(info); 246var stopProcess = Process.Start(stopScriptInfo); 308var stopProcess = Process.Start(stopScriptInfo);
Microsoft.AspNetCore.SpaServices.Extensions (4)
Npm\NodeScriptRunner.cs (4)
19private Process? _npmProcess; 123private static Process LaunchNodeProcess(ProcessStartInfo startInfo, string commandName) 127var process = Process.Start(startInfo)!;
Microsoft.Build (57)
BackEnd\BuildManager\BuildManager.cs (6)
514private void UpdatePriority(Process p, ProcessPriorityClass priority) 543IEnumerable<Process>? processes = _nodeManager?.GetProcesses(); 546foreach (Process p in processes) 555foreach (Process p in processes) 964/// <returns>Enumeration of <see cref="Process"/> objects that were valid during the time of call to this function.</returns> 965public IEnumerable<Process> GetWorkerProcesses()
BackEnd\BuildManager\CoordinatorClient.cs (2)
473Process? process = Process.Start(startInfo);
BackEnd\Client\MSBuildClient.cs (3)
559using Process msbuildProcess = nodeLauncher.Start(launchData, nodeId: 0); 846using 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); 326private 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) 950private readonly Process _process; 952internal Process Process { get { return _process; } } 1051Process 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)
878using Process currentProcess = Process.GetCurrentProcess();
Evaluation\ProjectRootElementCache.cs (1)
685Trace.WriteLine($"{prefix} {Process.GetCurrentProcess().Id} | {message}{param1}");
Instance\TaskFactories\TaskHostTask.cs (1)
384Process.GetCurrentProcess().Id,
Microsoft.Build.Framework (12)
BackEnd\Handshake.cs (2)
126using var currentProcess = Process.GetCurrentProcess();
EnvironmentUtilities.cs (2)
90using Process currentProcess = Process.GetCurrentProcess();
Telemetry\CrashTelemetry.cs (4)
456using var process = System.Diagnostics.Process.GetCurrentProcess(); 480using 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)
169using var process = Process.GetProcessById(serverProcessId); 651if (Process.Start(startInfo) is { } process)
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
125var processId = Process.GetCurrentProcess().Id;
Microsoft.Build.Tasks.Core (2)
ManifestUtil\SecurityUtil.cs (2)
817Process signTool = null; 821signTool = Process.Start(startInfo);
Microsoft.Build.Utilities.Core (10)
ToolTask.cs (10)
361/// Overridable function called after <see cref="Process.Start()"/> in <see cref="ExecuteTool"/> 730/// <param name="proc">Fully populated <see cref="Process"/> instance representing the tool process to be started.</param> 731/// <returns>A started process. This could be <paramref name="proc"/> or another <see cref="Process"/> instance.</returns> 732protected virtual Process StartToolProcess(Process proc) 757Process proc = null; 931private void HandleToolNotifications(Process proc) 1030private void KillToolProcessOnTimeout(Process proc, bool isBeingCancelled) 1073private void TerminateToolProcess(Process proc, bool isBeingCancelled) 1111private 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)
121var process = Process.Start(processStartInfo); 438private readonly Process _process; 450public 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)
493Process.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)
149var process = Process.Start(new ProcessStartInfo()
Microsoft.DotNet.Cli.Utils (10)
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 (5)
33private readonly Process _process; 151public UnixProcessReaper(Process process) : base(process) 215/// <inheritdoc cref="ProcessReaper(Process)"/> 216public static ProcessReaper Create(Process process) 238private 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)
ProcessExtensions.cs (1)
11public static bool TryGetHasExited(this Process process)
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\MarkItDownConditionHelper.cs (1)
30using Process process = new() { StartInfo = startInfo };
Microsoft.Extensions.Diagnostics.ResourceMonitoring (6)
Windows\Interop\ProcessInfo.cs (2)
16foreach (var process in Process.GetProcesses())
Windows\WindowsSnapshotProvider.cs (4)
108using var process = Process.GetCurrentProcess(); 122using var process = Process.GetCurrentProcess();
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.Http.Resilience.Tests (3)
BuildTransitive\GrpcNetClientFactoryVersionTargetTests.cs (3)
301using var process = Process.Start(processStartInfo) ?? throw new InvalidOperationException("Failed to start dotnet."); 320private static void KillProcess(Process process)
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.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 (8)
LocalDaemons\ContainerRuntimeOperations.cs (2)
61Task<ProcessTextOutput> loadTask = Process.RunAndCaptureTextAsync(loadInfo, processCancellation.Token); 206ProcessTextOutput output = await Process.RunAndCaptureTextAsync(startInfo, cancellationToken).ConfigureAwait(false);
LocalDaemons\ContainerRuntimes.cs (1)
141Process process = new()
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)
93using (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 (1)
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerConnection.cs (1)
405processId = Process.StartAndForget(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)
316var p = Process.GetProcessById(_testHostProcessId);
MiniDumpWriteDump.cs (1)
25public static void CollectDumpUsingMiniDumpWriteDump(Process process, string outputFile, MiniDumpTypeOption type)
NetClientHangDumper.cs (4)
24var process = Process.GetProcessById(processId); 61foreach (var p in bottomUpTree) 111foreach (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 (24)
common\System\ProcessHelper.cs (15)
24private readonly Process _currentProcess = Process.GetCurrentProcess(); 56var process = new Process(); 96process.OutputDataReceived += (sender, args) => outputCallBack(sender as Process, args.Data); 115errorCallback(sender as Process, args.Data); 126if (sender is Process p) 226/// all <see cref="Process.ErrorDataReceived"/> callbacks have completed - and therefore the captured 271return Process.GetProcessById(processId).ProcessName; 279if (process is Process proc && proc.HasExited) 299var process = processId == _currentProcess.Id ? _currentProcess : Process.GetProcessById(processId); 316if (process is Process proc && !proc.HasExited) 330var proc = process as Process; 352if (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)
64private Process? _testHostProcess; 546_createNoNewWindow) as Process; 551_testHostProcess = Process.GetProcessById(processId); 566internal static void AdjustProcessPriorityBasedOnSettings(Process testHostProcess, IDictionary<string, string?>? testHostEnvironmentVariables)
Hosting\DotnetTestHostManager.cs (3)
72private Process? _testHostProcess; 965_createNoNewWindow) as Process; 970_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 (6)
XMake.cs (6)
605using Process currentProcess = Process.GetCurrentProcess(); 1520using Process currentProcess = Process.GetCurrentProcess(); 2502using Process currentProcess = Process.GetCurrentProcess();
MSBuild.Coordinator (2)
CoordinatorServer.cs (2)
568using Process process = Process.GetProcessById(processId);
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 (2)
Commands\Package\Update\PackageUpdateIO.cs (2)
122using var process = Process.Start(processStartInfo);
NuGet.Common (3)
Migrations\Migration1.cs (1)
201using (var proc = new Process())
RuntimeEnvironmentHelper.cs (2)
62using (var process = Process.GetCurrentProcess())
NuGet.Credentials (3)
PluginCredentialProvider.cs (3)
263using var process = Process.Start(startInfo); 317private 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)
155using (var process = Process.GetCurrentProcess())
Plugins\Logging\ProcessLogMessage.cs (2)
20using (var process = Process.GetCurrentProcess())
Plugins\PluginManager.cs (2)
409using (var process = Process.GetCurrentProcess())
Plugins\PluginProcess.cs (3)
19private readonly Process _process; 70_process = Process.GetCurrentProcess(); 178if (sender is Process process)
Plugins\RequestHandlers\MonitorNuGetProcessExitRequestHandler.cs (4)
22private readonly ConcurrentDictionary<int, Process> _processes; 39_processes = new ConcurrentDictionary<int, Process>(); 103Process? process = null; 107process = _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 (13)
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (7)
106var exitStatus = Process.Run(new ProcessStartInfo(MacOSTrustCertificateCommandLine, MacOSTrustCertificateCommandLineArguments + tmpFile)); 170var checkTrustProcessOutput = Process.Run(checkTrustProcessStartInfo); 216var processExitStatus = Process.Run(processInfo); 257var processOutput = Process.RunAndCaptureText(processInfo); 284using var findCertificateProcess = Process.Start(new ProcessStartInfo( 354var processOutput = Process.RunAndCaptureText(processInfo);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (6)
696return Process.Run(startInfo).ExitCode == 0; 718return Process.Run(startInfo).ExitCode == 0; 746return Process.Run(startInfo).ExitCode == 0; 769if (Process.Run(startInfo).ExitCode == 0) 939var processOutput = Process.RunAndCaptureText(processInfo); 981var processOutput = Process.RunAndCaptureText(processInfo);
rzc (3)
ServerProtocol\ServerConnection.cs (1)
405processId = Process.StartAndForget(startInfo);
ShutdownCommand.cs (2)
59var process = Process.GetProcessById(response.ServerProcessId);
SelectTests (4)
GraphAffectedProjects.cs (2)
543using var process = Process.Start(startInfo)
Program.cs (2)
1282using var process = Process.Start(psi)
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 (91)
Microsoft\Win32\SafeHandles\SafeProcessHandle.cs (7)
69/// This API opens the handle immediately. In contrast, <see cref="Process.GetProcessById(int)"/> only checks whether 70/// the process is currently running; opening the process handle is deferred until <see cref="Process.SafeHandle"/> is accessed. 73/// On Windows, this API requests query/synchronize/terminate rights, while <see cref="Process.SafeHandle"/> requests 111/// This API opens the handle immediately. In contrast, <see cref="Process.TryGetProcessById(int, out Process)"/> only checks 112/// whether the process is currently running; opening the process handle is deferred until <see cref="Process.SafeHandle"/> is accessed. 115/// On Windows, this API requests query/synchronize/terminate rights, while <see cref="Process.SafeHandle"/> requests
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (1)
408filename = Process.GetPathToOpenFile() ?? throw new Win32Exception(Interop.Errors.ERROR_NO_ASSOCIATION, SR.UseShellExecuteNoOpenProgram);
System\Diagnostics\Process.cs (46)
90/// Initializes a new instance of the <see cref='System.Diagnostics.Process'/> class. 99if (GetType() == typeof(Process)) 551/// 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'/>. 630/// Gets or sets whether the <see cref='System.Diagnostics.Process.Exited'/> 805/// Causes the <see cref="Process"/> component to wait the specified <paramref name="timeout"/> for the associated process to enter an idle state. 823/// No process is associated with this <see cref="Process"/> object. 990/// Returns a new <see cref='System.Diagnostics.Process'/> component given a process identifier and 994public static Process GetProcessById(int processId, string machineName) 1007/// Returns a new <see cref='System.Diagnostics.Process'/> component given the 1011public static Process GetProcessById(int processId) 1023/// Attempts to get a <see cref="Process"/> instance for an existing process with the specified process ID. 1026/// <param name="process">When this method returns <see langword="true"/>, contains a <see cref="Process"/> representing the opened process; otherwise, <see langword="null"/>.</param> 1032public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Process? process) 1049/// Creates an array of <see cref='System.Diagnostics.Process'/> components that are 1058public static Process[] GetProcessesByName(string? processName) 1068/// Creates an array of <see cref="Process"/> components that are associated with process resources on a 1074public static Process[] GetProcessesByName(string? processName, string machineName) 1085/// Creates a new <see cref='System.Diagnostics.Process'/> 1092public static Process[] GetProcesses() 1102/// Creates a new <see cref='System.Diagnostics.Process'/> 1110public static Process[] GetProcesses(string machineName) 1118private static Process[] CreateProcessArray(ArrayBuilder<ProcessInfo> processInfos, string machineName, bool isRemoteMachine) 1122Process[] processes = new Process[processInfos.Count]; 1135/// Returns a new <see cref='System.Diagnostics.Process'/> 1139public static Process GetCurrentProcess() 1146/// Raises the <see cref='System.Diagnostics.Process.Exited'/> event. 1187/// that has been cached inside the process component. After <see cref='System.Diagnostics.Process.Refresh'/> is called, the 1258/// Starts a process specified by the <see cref='System.Diagnostics.Process.StartInfo'/> property of this <see cref='System.Diagnostics.Process'/> 1260/// <see cref='System.Diagnostics.Process'/> . If a process resource is reused 1261/// rather than started, the reused process is associated with this <see cref='System.Diagnostics.Process'/> 1507/// document or application file. Associates the process resource with a new <see cref='System.Diagnostics.Process'/> 1514public static Process Start(string fileName) 1526/// with a new <see cref='System.Diagnostics.Process'/> 1533public static Process Start(string fileName, string? arguments) 1547public static Process Start(string fileName, IEnumerable<string> arguments) 1556/// Associates the process resource with a new <see cref='System.Diagnostics.Process'/> 1563public static Process? Start(ProcessStartInfo startInfo) 1567Process process = new Process(); 1631/// Instructs the <see cref='System.Diagnostics.Process'/> component to wait 1908/// Instructs the <see cref='System.Diagnostics.Process'/> component to start 1945/// Instructs the <see cref='System.Diagnostics.Process'/> component to start 1984/// Instructs the <see cref='System.Diagnostics.Process'/> component to cancel the asynchronous operation 2005/// Instructs the <see cref='System.Diagnostics.Process'/> component to cancel the asynchronous operation
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)
243using Process process = Start(startInfo)!; 321using Process process = Start(startInfo)!;
System\Diagnostics\Process.Unix.cs (9)
40public static Process Start(string fileName, string userName, SecureString password, string domain) 47public static Process Start(string fileName, string arguments, string userName, SecureString password, string domain) 117List<Process> stoppedProcesses = []; 129foreach (Process process in stoppedProcesses) 160private bool StopTree(ref List<Exception>? exceptions, List<Process> stoppedProcesses) 184List<Process> children = GetChildProcesses(); 185foreach (Process childProcess in children) 370private bool IsParentOf(Process possibleChildProcess) 382private 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\Runtime\InteropServices\UnixProcessStartArguments.cs (3)
93/// <returns>A new <see cref="Process"/> instance associated with the started process.</returns> 101public static Process Start(ProcessStartInfo startInfo, Func<UnixProcessStartArguments, int> callback) 119Process process = new();
System\Runtime\InteropServices\WindowsProcessStartArguments.cs (2)
81/// <returns>A new <see cref="Process"/> instance associated with the started process.</returns> 86public static Process Start(ProcessStartInfo startInfo, Func<WindowsProcessStartArguments, nint> callback)
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)
1457Process process = Process.GetCurrentProcess(); 1483Process.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)
169using var process = Process.GetProcessById(serverProcessId); 651if (Process.Start(startInfo) is { } process)
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
125var 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)
169using var process = Process.GetProcessById(serverProcessId); 651if (Process.Start(startInfo) is { } process)
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
125var 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)