Skip to content

HttpSysListener throws HEFException when WebApplication disposed (net10.0) #65259

@perclausen

Description

@perclausen

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When using HttpSys and targeting net10.0 WebApplication throws HEFException when disposed.

The error is only thrown when run from Visual Studio where Debugger is attached (Debug and Release).

The error is not thrown when targeting net8.0 or net9.0, so an issue introduced in net10.0.

Expected Behavior

WebApplication does not throw HEFException when disposed.

Steps To Reproduce

Please see this repository.

Exceptions (if any)

fail: Microsoft.AspNetCore.Server.HttpSys.HttpSysListener[15]
      Dispose
      System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
         at Interop.Kernel32.CloseHandle(IntPtr handle)
         at Microsoft.Win32.SafeHandles.SafeFileHandle.ReleaseHandle()
         at System.Runtime.InteropServices.SafeHandle.InternalRelease(Boolean disposeOrFinalizeOperation)
         at System.Runtime.InteropServices.SafeHandle.Dispose()
         at Microsoft.AspNetCore.Server.HttpSys.HttpSysListener.DisposeInternal()
         at Microsoft.AspNetCore.Server.HttpSys.HttpSysListener.Dispose(Boolean disposing)

.NET Version

10.0.102

Anything else?

dotnet --list-sdks
6.0.428 [C:\Program Files\dotnet\sdk]
8.0.319 [C:\Program Files\dotnet\sdk]
8.0.417 [C:\Program Files\dotnet\sdk]
9.0.310 [C:\Program Files\dotnet\sdk]
10.0.102 [C:\Program Files\dotnet\sdk]
[System.Environment]::OSVersion

Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.26200.0 Microsoft Windows NT 10.0.26200.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: FixedThe bug or enhancement requested in this issue has been checked-in!area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-httpsys

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions