BackgroundService exceptions now propagate in .NET 11
Read OriginalThis article details a long-standing bug in .NET where BackgroundService exceptions thrown after the first await resulted in a critical log but exit code 0, misleading users into thinking the application terminated successfully. The fix in .NET 11 ensures that such exceptions propagate, causing the process to exit with a non-zero exit code (134 on Linux, 1 on Windows). The article explains the root cause, the async boundary issue, and provides code examples. It also mentions an opt-out option for those wanting the old behavior. This is highly relevant to IT/Technology, specifically .NET development and hosting infrastructure.
Comments
No comments yet
Be the first to share your thoughts!
Browser Extension
Get instant access to AllDevBlogs from your browser
Top of the Week
No top articles yet