NetSparkleUpdater/NetSparkle

Visual Basic compiler crashes when project uses NetSparkleUpdater.UI.WinForms.NetFramework and Async lambdas

Open

#709 opened on Jul 2, 2026

 (2 comments) (0 reactions) (0 assignees)C# (101 forks)auto 404
help wantedneed-more-infowaiting for author response

Repository metrics

Stars
 (822 stars)
PR merge metrics
 (PR metrics pending)

Description

With NetSparkleUpdater.UI.WinForms.NetFramework v3.1.0 (and prior) in a VB WinForms project compiling with VS2026, vbc.exe crashes and the project won't compile.

there is an entry in Windows Event Viewer: Application: vbc.exe Framework Version: v4.0.30319 Description: The application requested process termination through System.Environment.FailFast(string message). Message: System.InvalidOperationException: This program location is thought to be unreachable. File='/_/src/Compilers/VisualBasic/Portable/Lowering/AsyncRewriter/AsyncRewriter.vb' Line=131 at Microsoft.CodeAnalysis.VisualBasic.AsyncRewriter.CreateMethodBinder(MethodSymbol method)

I asked Copilot, and it responded as below:

Copilot: That's the smoking gun. The important part is:

System.InvalidOperationException: This program location is thought to be unreachable.

File='/_/src/Compilers/VisualBasic/Portable/Lowering/AsyncRewriter/AsyncRewriter.vb' Line=131

at Microsoft.CodeAnalysis.VisualBasic.AsyncRewriter.CreateMethodBinder(MethodSymbol method)

This is not a NetSparkle runtime issue and not an assembly-binding problem. It's an internal Roslyn VB compiler bug. The compiler is crashing while lowering (rewriting) an async method/lambda into its state machine. Specifically, it is inside the VB AsyncRewriter. The fact that: adding NetSparkleUpdater.UI.WinForms.NetFramework triggers it, removing that reference avoids it, the crash only occurs with Task.Run(Async Function() ...), strongly suggests that the additional metadata/type information introduced by the NetSparkle assemblies is exposing a bug in the VB compiler. End Copilot

Is there any possibility of this being fixed/worked around in a future release of NetSparkle.UI.WinForms?

Thank you.

Contributor guide