microsoft/aspire · error · Win32Exception
Failed to invoke UpdateProcThreadAttribute while starting…
Error message
Failed to invoke UpdateProcThreadAttribute while starting tracked browser CDP pipe.
What it means
A Win32Exception wrapping GetLastError from UpdateProcThreadAttribute in CreateWindowsProcess (BrowserLogsPipeBrowserProcessLauncher.Windows.cs:105). Aspire sets PROC_THREAD_ATTRIBUTE_HANDLE_LIST so only the two anonymous-pipe handles are inheritable by the Chromium child; failure means the handle-list attribute could not be attached and the browser process is not launched.
Solutions
- Read NativeErrorCode: ERROR_INVALID_HANDLE(6) — verify the AnonymousPipeServerStream client handles were not disposed before CreateProcess.
- ERROR_NOT_ENOUGH_MEMORY: free memory / raise the container limit and retry.
- Exclude antivirus/EDR process-creation hooking for the AppHost process.
- Update to the latest Aspire version and, if persistent, file an issue with the Win32 error code.
- Fall back to the WebSocket CDP transport if the pipe transport keeps failing.
Defensive patterns
Strategy: try-catch
Type guard
static bool IsUpdateAttrFailure(Win32Exception ex) => ex.Message.Contains("UpdateProcThreadAttribute"); Try / catch
try
{
StartBrowserPipeWindows();
}
catch (Win32Exception ex) when (IsUpdateAttrFailure(ex))
{
logger.LogError(ex, "UpdateProcThreadAttribute failed (Win32 error {Errno}); verify CDP pipe handles are still valid.", ex.NativeErrorCode);
throw;
} Prevention
- Never dispose the AnonymousPipeServerStream (or its client handles) before CreateProcess completes.
- Exclude EDR/AV handle tampering for the AppHost process.
- Watch for ERROR_INVALID_HANDLE (6) as a sign of handle-lifecycle bugs.
- Use the WebSocket CDP transport as an alternative if failures persist.
When it happens
Trigger: UpdateProcThreadAttribute returns FALSE during StartWindows — typically ERROR_INVALID_HANDLE (one of the two pipe client handles is invalid/closed), ERROR_INVALID_PARAMETER, or ERROR_NOT_ENOUGH_MEMORY.
Common situations: Pipe handles invalidated by another component closing them; security software tampering with handle values; memory pressure; misaligned attribute-list state from a prior failed InitializeProcThreadAttributeList.
Related errors
- Failed to invoke CloseHandle while starting tracked browser…
- Failed to invoke CreateProcessW while starting tracked…
- Failed to invoke GetExitCodeProcess while starting tracked…
- Failed to invoke InitializeProcThreadAttributeList while…
- Failed to invoke WaitForSingleObject while starting tracked…
AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16).
Data as JSON: /api/errors/ff6460c733216949.
Report an issue: GitHub.
Appendix: source
Thrown at src/Aspire.Hosting.Browsers/BrowserLogsPipeBrowserProcessLauncher.Windows.cs:105
{
throw CreateWindowsException("InitializeProcThreadAttributeList");
}
for (var i = 0; i < inheritedHandles.Length; i++)
{
Marshal.WriteIntPtr(handleList, i * IntPtr.Size, inheritedHandles[i]);
}
if (!UpdateProcThreadAttribute(
attributeList,
0,
s_procThreadAttributeHandleList,
handleList,
(UIntPtr)(uint)(IntPtr.Size * inheritedHandles.Length),
IntPtr.Zero,
IntPtr.Zero))
{
throw CreateWindowsException("UpdateProcThreadAttribute");
}
var startupInfo = new STARTUPINFOEX
{
StartupInfo = new STARTUPINFO
{
cb = Marshal.SizeOf<STARTUPINFOEX>()
},
lpAttributeList = attributeList
};
startupInfoPointer = Marshal.AllocHGlobal(Marshal.SizeOf<STARTUPINFOEX>());
Marshal.StructureToPtr(startupInfo, startupInfoPointer, fDeleteOld: false);
if (!CreateProcessW(
lpApplicationName: IntPtr.Zero,
lpCommandLine: commandLine,
lpProcessAttributes: IntPtr.Zero,
lpThreadAttributes: IntPtr.Zero,View on GitHub (pinned to 25830f84bd)