[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DZRRJP3S662NFSG1RSPQQ7":3,"skill-same:01M6DZRRJP3S662NFSG1RSPQQ7":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M6DZRRJP3S662NFSG1RSPQQ7","process-api-net11",null,"Provides guidance on the new System.Diagnostics.Process APIs introduced in .NET 11: Process.Run, Process.RunAndCaptureText, Process.StartAndForget, Process.ReadAllText\u002FBytes\u002FLines, KillOnParentExit, InheritedHandles, and StartDetached. USE FOR: starting, orchestrating, or capturing output from external processes in applications targeting net11.0 or later. DO NOT USE FOR: applications targeting .NET 10 or earlier, or basic pre-.NET 11 Process.Start usage without new APIs.","managedcode\u002Fdotnet-skills","managedcode","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F78253589?v=4","01M6DYDJR3EG8KB5G4PC65XCTT","Managed Code","01M6DYDJX0ZT432N04NYJW89DN",515,"MIT","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fexternal-sources\u002Fupstreams\u002Fdotnet-skills\u002Fplugins\u002Fdotnet11\u002Fskills\u002Fprocess-api-net11\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"api","process","process api net11","later","new","for","targeting","usage","output","processes","basic","do","diagnostics","guidance","use","system","applications","start","run","2026-11-10 10:12:30",false,"---\nname: process-api-net11\ndescription: >\n  Provides guidance on the new System.Diagnostics.Process APIs introduced in .NET 11:\n  Process.Run, Process.RunAndCaptureText, Process.StartAndForget, Process.ReadAllText\u002FBytes\u002FLines,\n  KillOnParentExit, InheritedHandles, and StartDetached.\n  USE FOR: starting, orchestrating, or capturing output from external processes in applications targeting net11.0 or later.\n  DO NOT USE FOR: applications targeting .NET 10 or earlier, or basic pre-.NET 11 Process.Start usage without new APIs.\nlicense: MIT\n---\n\n# Process API Improvements — .NET 11\n\nNew APIs added to `System.Diagnostics.Process` in .NET 11 simplify process management, eliminate boilerplate, and prevent common deadlock patterns when capturing output in .NET 11 or later applications.\n\n## When to Use\n\n- Running or orchestrating external processes in a .NET 11 (or later) project.\n- Needing to start a process, wait for it to exit, and capture its output\u002Ferror streams without risking deadlocks (`Process.RunAndCaptureText[Async]`).\n- Wanting to ensure child processes are automatically terminated when the parent process exits (`KillOnParentExit`).\n- Requiring lightweight, low-overhead process creation via `SafeProcessHandle` on supported platforms.\n- Requiring fine-grained control over handle inheritance (`InheritedHandles`) or starting detached processes (`StartDetached`).\n\n## When Not to Use\n\n- The project targets .NET 10 or earlier — these APIs are not available before .NET 11.\n- The default `Process.Start()` is sufficient and does not require output capturing or advanced lifecycle rules.\n\n## Target Framework\n\n```xml\n\u003CTargetFramework>net11.0\u003C\u002FTargetFramework>\n```\n\n## New APIs\n\n### Types\n\nBefore using the new convenience methods, note the following types. Use the framework types directly:\n\n| Type | Kind | Read-only properties |\n|------|------|----------------------|\n| `ProcessExitStatus` | Sealed class | `int ExitCode`, `bool Canceled`, `PosixSignal? Signal` |\n| `ProcessTextOutput` | Sealed class | `ProcessExitStatus ExitStatus`, `string StandardOutput`, `string StandardError`, `int ProcessId` |\n| `ProcessOutputLine` | Readonly struct | `string Content`, `bool StandardError` |\n\n`ProcessExitStatus` describes the outcome of a completed process. Interpret `ExitCode` using the external command's contract; there is no universal `Success` property. `ProcessTextOutput` contains the exit status, captured output and error text, and process ID. `ProcessOutputLine` identifies one output line and whether it came from standard error.\n\n### High-Level Convenience APIs\n\n#### Static Methods\n\nThe `ProcessStartInfo` overloads below require `UseShellExecute = false`, which is the default for .NET.\n\n##### `Process.Run` \u002F `Process.RunAsync`\nStarts a process and waits for it to exit, returning the exit status. Does not capture standard output or error. Passing `silent: true` discards standard output and error by internally redirecting standard handles to the `NUL` device. On timeout or cancellation, the process is killed.\n```csharp\npublic static ProcessExitStatus Run(string fileName, IEnumerable\u003Cstring>? arguments = null, bool silent = false, TimeSpan? timeout = null)\npublic static Task\u003CProcessExitStatus> RunAsync(string fileName, IEnumerable\u003Cstring>? arguments = null, bool silent = false, CancellationToken cancellationToken = default)\npublic static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeout = null)\npublic static Task\u003CProcessExitStatus> RunAsync(ProcessStartInfo startInfo, CancellationToken cancellationToken = default)\n```\n\n##### `Process.RunAndCaptureText` \u002F `Process.RunAndCaptureTextAsync`\nStarts a process, captures both standard output and error, and waits for it to exit. Extremely useful for avoiding deadlocks on stream redirection. On timeout or cancellation, the process is killed.\n\nWhen using the `ProcessStartInfo` overloads, the caller is responsible for setting `RedirectStandardOutput = true` and `RedirectStandardError = true` on `ProcessStartInfo` (because BCL APIs cannot modify the input arguments they were given).\n```csharp\npublic static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable\u003Cstring>? arguments = null, TimeSpan? timeout = null)\npublic static Task\u003CProcessTextOutput> RunAndCaptureTextAsync(string fileName, IEnumerable\u003Cstring>? arguments = null, CancellationToken cancellationToken = default)\npublic static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, TimeSpan? timeout = null)\npublic static Task\u003CProcessTextOutput> RunAndCaptureTextAsync(ProcessStartInfo startInfo, CancellationToken cancellationToken = default)\n```\n\n##### `Process.StartAndForget`\nThere is a common misconception that when a process is disposed, it's also being killed. This is not the case, as `Process.Dispose` only releases the resources associated with the process, but does not kill it.\n\nTo make it easier to start a process without the need to worry about disposing it, `Process.StartAndForget` was introduced. The method starts an executable, returns its ID, and immediately releases all handle resources associated with it. Standard handles not supplied through `StandardInputHandle`, `StandardOutputHandle`, or `StandardErrorHandle` go to the null device by default.\n\n`StartAndForget` throws `InvalidOperationException` if `UseShellExecute` or any `RedirectStandardInput`, `RedirectStandardOutput`, or `RedirectStandardError` flag is true. Use a capture or streaming API if output needs to be read.\n```csharp\npublic static int StartAndForget(string fileName, IEnumerable\u003Cstring>? arguments = null)\npublic static int StartAndForget(ProcessStartInfo startInfo)\n```\n\n#### Instance Methods\nThese methods are called on a `Process` instance to directly read stdout and stderr, guaranteeing no OS pipe buffer overflow deadlocks.\n\n*Note: Calling these methods requires `RedirectStandardOutput = true` and `RedirectStandardError = true` on the `ProcessStartInfo` passed to `Process.Start`.*\n\n```csharp\npublic (string StandardOutput, string StandardError) ReadAllText(TimeSpan? timeout = null)\npublic Task\u003C(string StandardOutput, string StandardError)> ReadAllTextAsync(CancellationToken cancellationToken = default)\npublic (byte[] StandardOutput, byte[] StandardError) ReadAllBytes(TimeSpan? timeout = null)\npublic Task\u003C(byte[] StandardOutput, byte[] StandardError)> ReadAllBytesAsync(CancellationToken cancellationToken = default)\npublic IEnumerable\u003CProcessOutputLine> ReadAllLines(TimeSpan? timeout = null)\npublic IAsyncEnumerable\u003CProcessOutputLine> ReadAllLinesAsync(CancellationToken cancellationToken = default)\n```\n\nExample of deconstructing the tuple return:\n```csharp\nvar (stdout, stderr) = await process.ReadAllTextAsync();\n```\n\n### ProcessStartInfo Properties\n\n#### `KillOnParentExit`\nEnsures that the spawned child process is terminated when the current (parent) process exits (including fatal crash and being force killed). Works across Windows, Linux, and Android.\n```csharp\npublic bool KillOnParentExit { get; set; }\n```\n\nIn cross-platform code, guard the property assignment with a supported-platform check, not only the assigned value. If automatic teardown is required, fail explicitly on an unsupported platform instead of starting an unprotected child process.\n`KillOnParentExit` requires `UseShellExecute = false`.\n\n#### `InheritedHandles`\nProvides precise control over which handles (file descriptors) are inherited by the child process, preventing accidental resource leaks.\n- Standard handles (`stdin`, `stdout`, `stderr`) are always included (no need to add them to the list).\n- Setting the list to an empty list means only standard handles get inherited.\n- Only `SafeFileHandle` and `SafePipeHandle` instances are allowed as of today.\n- No global lock is used when spawning new processes on Windows (important for tuning projects that spawn multiple processes in parallel).\n- Concurrent process starts must not pass the same handle in `InheritedHandles`: the runtime temporarily changes its inheritance flags. Serialize starts that share a handle, or use separate handles for each concurrent start.\n- Do not enable inheritance on the handles before passing them; other process-start APIs could then inherit them unintentionally.\n- On Unix systems without native handle-inheritance control, setting this property can severely reduce process-start performance.\n- A non-null list requires `UseShellExecute = false` and cannot be combined with a non-empty `UserName`.\n```csharp\npublic IList\u003CSafeHandle>? InheritedHandles { get; set; }\n```\n\n#### `StartDetached`\nStarts the process detached from the parent's terminal or job session, ensuring it survives the parent's exit.\n```csharp\npublic bool StartDetached { get; set; }\n```\n\n`StartDetached` requires `UseShellExecute = false`.\n\n---\n\n## Examples\n\n### 1. One-Line Run and Capture Output\n\nRun a process and safely read all output text without stream deadlock risks. For simple CLI operations that don't need cancellation or async scalability, prefer the synchronous overload:\n\n```csharp\nusing System;\nusing System.Diagnostics;\n\n\u002F\u002F Run 'git status' and capture output\nProcessTextOutput result = Process.RunAndCaptureText(\"git\", [\"status\"]);\n\nif (result.ExitStatus.ExitCode == 0)\n{\n    Console.WriteLine($\"Git Output: {result.StandardOutput}\");\n}\nelse\n{\n    Console.WriteLine($\"Failed with exit code: {result.ExitStatus.ExitCode}\");\n    Console.WriteLine($\"Error: {result.StandardError}\");\n}\n```\n\n### 2. Auto-Killing Child Processes on Parent Exit\n\nOn Windows, Linux, and Android, ensure a long-running background worker process is killed when the main application terminates. On other platforms, this example stops before starting the child process:\n\n```csharp\nusing System;\nusing System.Diagnostics;\n\nProcessStartInfo startInfo = new(\"dotnet\", [\"run\", \"--project\", \"BackgroundWorker.csproj\"]);\n\nif (OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsAndroid())\n{\n    startInfo.KillOnParentExit = true;\n}\nelse\n{\n    throw new PlatformNotSupportedException(\"This example requires Windows, Linux, or Android.\");\n}\n\nusing Process process = Process.Start(startInfo)!;\n\u002F\u002F The background worker is now tied to this process's lifecycle\n```\n\n### 3. Read All Lines From Output\n\nStart a process and read its output lines safely:\n\n```csharp\nusing System;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\n\nProcessStartInfo startInfo = new(\"ping\", [\"127.0.0.1\"])\n{\n    RedirectStandardOutput = true,\n    RedirectStandardError = true\n};\n\nusing Process process = Process.Start(startInfo)!;\n\u002F\u002F Read all output lines safely and asynchronously\nawait foreach (ProcessOutputLine line in process.ReadAllLinesAsync())\n{\n    string prefix = line.StandardError ? \"[Err]\" : \"[Out]\";\n    Console.WriteLine($\"{prefix} > {line.Content}\");\n}\n```\n\n### 4. Read Entire Output Deadlock-Free (Tuple Return)\n\nStart a process with custom `ProcessStartInfo` and read both stdout and stderr into a deconstructed tuple without buffer deadlocks:\n\n```csharp\nusing System;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\n\nProcessStartInfo startInfo = new(\"git\", [\"diff\"])\n{\n    RedirectStandardOutput = true,\n    RedirectStandardError = true\n};\n\nusing Process process = Process.Start(startInfo)!;\nvar (stdout, stderr) = await process.ReadAllTextAsync();\n\nConsole.WriteLine($\"Diff output: {stdout}\");\n```\n\n### 5. Start and Forget (Fire & Forget)\n\nLaunch a helper executable without holding onto system handle structures:\n\n```csharp\nusing System;\nusing System.Diagnostics;\n\n\u002F\u002F Fire and forget, getting back only the process ID\nint pid = Process.StartAndForget(\"notepad.exe\");\nConsole.WriteLine($\"Notepad started with PID: {pid}\");\n```\n","# Process API Improvements — .NET 11\n\nNew APIs added to `System.Diagnostics.Process` in .NET 11 simplify process management, eliminate boilerplate, and prevent common deadlock patterns when capturing output in .NET 11 or later applications.\n\n## When to Use\n\n- Running or orchestrating external processes in a .NET 11 (or later) project.\n- Needing to start a process, wait for it to exit, and capture its output\u002Ferror streams without risking deadlocks (`Process.RunAndCaptureText[Async]`).\n- Wanting to ensure child processes are automatically terminated when the parent process exits (`KillOnParentExit`).\n- Requiring lightweight, low-overhead process creation via `SafeProcessHandle` on supported platforms.\n- Requiring fine-grained control over handle inheritance (`InheritedHandles`) or starting detached processes (`StartDetached`).\n\n## When Not to Use\n\n- The project targets .NET 10 or earlier — these APIs are not available before .NET 11.\n- The default `Process.Start()` is sufficient and does not require output capturing or advanced lifecycle rules.\n\n## Target Framework\n\n```xml\n\u003CTargetFramework>net11.0\u003C\u002FTargetFramework>\n```\n\n## New APIs\n\n### Types\n\nBefore using the new convenience methods, note the following types. Use the framework types directly:\n\n| Type | Kind | Read-only properties |\n|------|------|----------------------|\n| `ProcessExitStatus` | Sealed class | `int ExitCode`, `bool Canceled`, `PosixSignal? Signal` |\n| `ProcessTextOutput` | Sealed class | `ProcessExitStatus ExitStatus`, `string StandardOutput`, `string StandardError`, `int ProcessId` |\n| `ProcessOutputLine` | Readonly struct | `string Content`, `bool StandardError` |\n\n`ProcessExitStatus` describes the outcome of a completed process. Interpret `ExitCode` using the external command's contract; there is no universal `Success` property. `ProcessTextOutput` contains the exit status, captured output and error text, and process ID. `ProcessOutputLine` identifies one output line and whether it came from standard error.\n\n### High-Level Convenience APIs\n\n#### Static Methods\n\nThe `ProcessStartInfo` overloads below require `UseShellExecute = false`, which is the default for .NET.\n\n##### `Process.Run` \u002F `Process.RunAsync`\nStarts a process and waits for it to exit, returning the exit status. Does not capture standard output or error. Passing `silent: true` discards standard output and error by internally redirecting standard handles to the `NUL` device. On timeout or cancellation, the process is killed.\n```csharp\npublic static ProcessExitStatus Run(string fileName, IEnumerable\u003Cstring>? arguments = null, bool silent = false, TimeSpan? timeout = null)\npublic static Task\u003CProcessExitStatus> RunAsync(string fileName, IEnumerable\u003Cstring>? arguments = null, bool silent = false, CancellationToken cancellationToken = default)\npublic static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeout = null)\npublic static Task\u003CProcessExitStatus> RunAsync(ProcessStartInfo startInfo, CancellationToken cancellationToken = default)\n```\n\n##### `Process.RunAndCaptureText` \u002F `Process.RunAndCaptureTextAsync`\nStarts a process, captures both standard output and error, and waits for it to exit. Extremely useful for avoiding deadlocks on stream redirection. On timeout or cancellation, the process is killed.\n\nWhen using the `ProcessStartInfo` overloads, the caller is responsible for setting `RedirectStandardOutput = true` and `RedirectStandardError = true` on `ProcessStartInfo` (because BCL APIs cannot modify the input arguments they were given).\n```csharp\npublic static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable\u003Cstring>? arguments = null, TimeSpan? timeout = null)\npublic static Task\u003CProcessTextOutput> RunAndCaptureTextAsync(string fileName, IEnumerable\u003Cstring>? arguments = null, CancellationToken cancellationToken = default)\npublic static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, TimeSpan? timeout = null)\npublic static Task\u003CProcessTextOutput> RunAndCaptureTextAsync(ProcessStartInfo startInfo, CancellationToken cancellationToken = default)\n```\n\n##### `Process.StartAndForget`\nThere is a common misconception that when a process is disposed, it's also being killed. This is not the case, as `Process.Dispose` only releases the resources associated with the process, but does not kill it.\n\nTo make it easier to start a process without the need to worry about disposing it, `Process.StartAndForget` was introduced. The method starts an executable, returns its ID, and immediately releases all handle resources associated with it. Standard handles not supplied through `StandardInputHandle`, `StandardOutputHandle`, or `StandardErrorHandle` go to the null device by default.\n\n`StartAndForget` throws `InvalidOperationException` if `UseShellExecute` or any `RedirectStandardInput`, `RedirectStandardOutput`, or `RedirectStandardError` flag is true. Use a capture or streaming API if output needs to be read.\n```csharp\npublic static int StartAndForget(string fileName, IEnumerable\u003Cstring>? arguments = null)\npublic static int StartAndForget(ProcessStartInfo startInfo)\n```\n\n#### Instance Methods\nThese methods are called on a `Process` instance to directly read stdout and stderr, guaranteeing no OS pipe buffer overflow deadlocks.\n\n*Note: Calling these methods requires `RedirectStandardOutput = true` and `RedirectStandardError = true` on the `ProcessStartInfo` passed to `Process.Start`.*\n\n```csharp\npublic (string StandardOutput, string StandardError) ReadAllText(TimeSpan? timeout = null)\npublic Task\u003C(string StandardOutput, string StandardError)> ReadAllTextAsync(CancellationToken cancellationToken = default)\npublic (byte[] StandardOutput, byte[] StandardError) ReadAllBytes(TimeSpan? timeout = null)\npublic Task\u003C(byte[] StandardOutput, byte[] StandardError)> ReadAllBytesAsync(CancellationToken cancellationToken = default)\npublic IEnumerable\u003CProcessOutputLine> ReadAllLines(TimeSpan? timeout = null)\npublic IAsyncEnumerable\u003CProcessOutputLine> ReadAllLinesAsync(CancellationToken cancellationToken = default)\n```\n\nExample of deconstructing the tuple return:\n```csharp\nvar (stdout, stderr) = await process.ReadAllTextAsync();\n```\n\n### ProcessStartInfo Properties\n\n#### `KillOnParentExit`\nEnsures that the spawned child process is terminated when the current (parent) process exits (including fatal crash and being force killed). Works across Windows, Linux, and Android.\n```csharp\npublic bool KillOnParentExit { get; set; }\n```\n\nIn cross-platform code, guard the property assignment with a supported-platform check, not only the assigned value. If automatic teardown is required, fail explicitly on an unsupported platform instead of starting an unprotected child process.\n`KillOnParentExit` requires `UseShellExecute = false`.\n\n#### `InheritedHandles`\nProvides precise control over which handles (file descriptors) are inherited by the child process, preventing accidental resource leaks.\n- Standard handles (`stdin`, `stdout`, `stderr`) are always included (no need to add them to the list).\n- Setting the list to an empty list means only standard handles get inherited.\n- Only `SafeFileHandle` and `SafePipeHandle` instances are allowed as of today.\n- No global lock is used when spawning new processes on Windows (important for tuning projects that spawn multiple processes in parallel).\n- Concurrent process starts must not pass the same handle in `InheritedHandles`: the runtime temporarily changes its inheritance flags. Serialize starts that share a handle, or use separate handles for each concurrent start.\n- Do not enable inheritance on the handles before passing them; other process-start APIs could then inherit them unintentionally.\n- On Unix systems without native handle-inheritance control, setting this property can severely reduce process-start performance.\n- A non-null list requires `UseShellExecute = false` and cannot be combined with a non-empty `UserName`.\n```csharp\npublic IList\u003CSafeHandle>? InheritedHandles { get; set; }\n```\n\n#### `StartDetached`\nStarts the process detached from the parent's terminal or job session, ensuring it survives the parent's exit.\n```csharp\npublic bool StartDetached { get; set; }\n```\n\n`StartDetached` requires `UseShellExecute = false`.\n\n---\n\n## Examples\n\n### 1. One-Line Run and Capture Output\n\nRun a process and safely read all output text without stream deadlock risks. For simple CLI operations that don't need cancellation or async scalability, prefer the synchronous overload:\n\n```csharp\nusing System;\nusing System.Diagnostics;\n\n\u002F\u002F Run 'git status' and capture output\nProcessTextOutput result = Process.RunAndCaptureText(\"git\", [\"status\"]);\n\nif (result.ExitStatus.ExitCode == 0)\n{\n    Console.WriteLine($\"Git Output: {result.StandardOutput}\");\n}\nelse\n{\n    Console.WriteLine($\"Failed with exit code: {result.ExitStatus.ExitCode}\");\n    Console.WriteLine($\"Error: {result.StandardError}\");\n}\n```\n\n### 2. Auto-Killing Child Processes on Parent Exit\n\nOn Windows, Linux, and Android, ensure a long-running background worker process is killed when the main application terminates. On other platforms, this example stops before starting the child process:\n\n```csharp\nusing System;\nusing System.Diagnostics;\n\nProcessStartInfo startInfo = new(\"dotnet\", [\"run\", \"--project\", \"BackgroundWorker.csproj\"]);\n\nif (OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsAndroid())\n{\n    startInfo.KillOnParentExit = true;\n}\nelse\n{\n    throw new PlatformNotSupportedException(\"This example requires Windows, Linux, or Android.\");\n}\n\nusing Process process = Process.Start(startInfo)!;\n\u002F\u002F The background worker is now tied to this process's lifecycle\n```\n\n### 3. Read All Lines From Output\n\nStart a process and read its output lines safely:\n\n```csharp\nusing System;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\n\nProcessStartInfo startInfo = new(\"ping\", [\"127.0.0.1\"])\n{\n    RedirectStandardOutput = true,\n    RedirectStandardError = true\n};\n\nusing Process process = Process.Start(startInfo)!;\n\u002F\u002F Read all output lines safely and asynchronously\nawait foreach (ProcessOutputLine line in process.ReadAllLinesAsync())\n{\n    string prefix = line.StandardError ? \"[Err]\" : \"[Out]\";\n    Console.WriteLine($\"{prefix} > {line.Content}\");\n}\n```\n\n### 4. Read Entire Output Deadlock-Free (Tuple Return)\n\nStart a process with custom `ProcessStartInfo` and read both stdout and stderr into a deconstructed tuple without buffer deadlocks:\n\n```csharp\nusing System;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\n\nProcessStartInfo startInfo = new(\"git\", [\"diff\"])\n{\n    RedirectStandardOutput = true,\n    RedirectStandardError = true\n};\n\nusing Process process = Process.Start(startInfo)!;\nvar (stdout, stderr) = await process.ReadAllTextAsync();\n\nConsole.WriteLine($\"Diff output: {stdout}\");\n```\n\n### 5. Start and Forget (Fire & Forget)\n\nLaunch a helper executable without holding onto system handle structures:\n\n```csharp\nusing System;\nusing System.Diagnostics;\n\n\u002F\u002F Fire and forget, getting back only the process ID\nint pid = Process.StartAndForget(\"notepad.exe\");\nConsole.WriteLine($\"Notepad started with PID: {pid}\");\n```\n",{"name":5,"license":15,"description":43},"Provides guidance on the new System.Diagnostics.Process APIs introduced in .NET 11: Process.Run, Process.RunAndCaptureText, Process.StartAndForget, Process.ReadAllText\u002FBytes\u002FLines, KillOnParentExit, InheritedHandles, and StartDetached. USE FOR: starting, orchestrating, or capturing output from external processes in applications targeting net11.0 or later. DO NOT USE FOR: applications targeting .NET 10 or earlier, or basic pre-.NET 11 Process.Start usage without new APIs.\n","main","497cc9aba79a931ac6fb8d36a48cc22fe3d6d74b","external-sources\u002Fupstreams\u002Fdotnet-skills\u002Fplugins\u002Fdotnet11\u002Fskills\u002Fprocess-api-net11",41,"https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills","https:\u002F\u002Fskills.managed-code.com","https:\u002F\u002Fgithub.com\u002Fmanagedcode","https:\u002F\u002Fwww.managed-code.com","Open Source Community for .NET Developers: Reliable, Actively Maintained, and Community-Driven. Made in Ukraine 🇺🇦 with ❤️","2026-11-14 19:05:44",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add managedcode\u002Fdotnet-skills --skill process-api-net11",{"tool":60,"command":61},"bunx","bunx skills add managedcode\u002Fdotnet-skills --skill process-api-net11",{"tool":63,"command":64},"pnpm","pnpm dlx skills add managedcode\u002Fdotnet-skills --skill process-api-net11","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fexternal-sources\u002Fupstreams\u002Fdotnet-skills\u002Fplugins\u002Fdotnet11\u002Fskills\u002Fprocess-api-net11\u002FSKILL.md",true,[68],{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fbrainstorming_methods.md","REFERENCE","参考文档",12065,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__Microck--claude-scientific-skills\u002Fscientific-skills\u002Fscientific-brainstorming\u002Freferences\u002Fbrainstorming_methods.md",[75,100,118,147,157,180],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":38},"01M6DYQE1Y9FHAQHEDTVFQ3447","xtwitter-scraper","Use XTwitterScraper when a .NET application needs typed access to Xquik's X automation REST API for tweet search, user lookup, posting workflows, extraction jobs, monitors, webhooks, or giveaway draws. USE FOR: integrating the XTwitterScraper NuGet package; reviewing Xquik API client usage; modeling API-key configuration, pagination, binary exports, raw responses, retries, and webhook\u002Fevent flows in .NET. DO NOT USE FOR: unrelated stacks; direct browser automation; generic social-media strategy; or code that does not call Xquik. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fcatalog\u002FLibraries\u002FXTwitterScraper\u002Fskills\u002Fxtwitter-scraper\u002FSKILL.md",[],[82,83,84,37,85,86,87,88,19,89,90,91,92,93,94,95,96,97,98,99],"xtwitter scraper","browser automation","workflows","code","browser","search","repository","Media","api client","access","edit","unrelated","webhooks","files","social","commands","modeling","webhook",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":38},"01M6DYQ9S4PE1H6G8MCH9T21HR","sep","Use Sep for high-performance separated-value parsing and writing in .NET, including delimiter inference, explicit parser\u002Fwriter options, and low-allocation row\u002Fcolumn workflows. USE FOR: delimited data needs are performance-sensitive and allocation-aware; project needs explicit control over separator inference, escaping, trimming, and header behavior;. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fcatalog\u002FLibraries\u002FSep\u002Fskills\u002Fsep\u002FSKILL.md",[],[102,107,108,84,109,37,88,110,111,112,92,113,93,95,30,114,115,116,97,117],"writing","performance","tasks","data","parsing","parser","context","writer","options","project","high-performance",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":38},"01M6DZS2DNEPXCGGF6SSCW6G5V","webgpu-threejs-tsl","Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fexternal-sources\u002Fupstreams\u002Fwebgpu-claude-skill\u002Fskills\u002Fwebgpu-threejs-tsl\u002FSKILL.md",[],[125,126,127,128,129,130,131,35,132,133,134,135,33,136,137,138,139,140,141,142,24,143,144,145,146],"webgpu","threejs","webgpu threejs tsl","setup","shaders","gpu","integration","js","node","syntax","guide","language","three","compute","post","processing","with","renderer","materials","wgsl","effects","when",{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":153,"publishedAt":38},"01M6DZS0BQXW2B56A289XF1X76","roslynk","Use Roslynk for semantic inspection and edits of *.cs, *.razor and *.cshtml solution files.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fexternal-sources\u002Fupstreams\u002Froslynk\u002Fskills\u002Froslynk\u002FSKILL.md",[],[149,33,95,154,155,24,156],"semantic","razor","inspection",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":38},"01M6DZRW6MEJCVW80K3S4XV60K","system-text-json-net11","Imperative guidance for the System.Text.Json APIs added in .NET 11: the built-in `JsonNamingPolicy.PascalCase` naming policy, and the strongly-typed generic `JsonSerializerOptions.GetTypeInfo` and `JsonSerializerOptions.TryGetTypeInfo` metadata accessors (generic overloads that return a typed `JsonTypeInfo`). USE ONLY when the user is targeting net11.0 or later and needs PascalCase JSON property or dictionary-key names without writing a custom naming policy, a strongly-typed generic `JsonTypeInfo` instead of the non-generic `JsonTypeInfo`, or a no-throw way to probe whether a type's serialization metadata is resolved. DO NOT USE when the target is earlier than net11.0, the requested behavior uses an established pre-net11 naming policy, or the user explicitly selected another JSON library.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fexternal-sources\u002Fupstreams\u002Fdotnet-skills\u002Fplugins\u002Fdotnet11\u002Fskills\u002Fsystem-text-json-net11\u002FSKILL.md",[],[34,164,165,166,107,167,168,169,170,171,172,33,173,174,32,22,30,175,176,177,25,24,178,179,146],"json","text","system text json net11","policy","metadata","library","serialization","behavior","user","only","probe","type","dictionary","naming","custom","generic",{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":38},"01M6DZRMGPYXYFYNWSFMDTY0QW","setup-local-sdk","Install a .NET SDK locally for safe preview testing, specific-version pinning, or reproducible team setups — without modifying the system-wide installation. USE FOR: trying .NET previews safely, testing specific SDK versions, installing MAUI or other workloads on a preview, updating or replacing an existing local SDK, creating reproducible team\u002FCI install scripts, configuring global.json paths. DO NOT USE FOR: system-wide SDK installs, .NET hosts older than 10, runtime-only installs, or projects not using SDK-style commands.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fexternal-sources\u002Fupstreams\u002Fdotnet-skills\u002Fplugins\u002Fdotnet\u002Fskills\u002Fsetup-local-sdk\u002FSKILL.md",[],[187,188,128,189,190,191,192,193,194,195,34,164,196,33,197,173,30,198,199,97,200,201,202,203,204,24],"sdk","setup local sdk","local","testing","safe","ci","Reproducible","team","projects","install","version","preview","installation","runtime","style","scripts","paths","hosts"]