NetSparkleUpdater / NetSparkleUpdater/NetSparkle

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

Open
#709 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted need-more-info waiting for author response
Dominant language
C#
Stars
832
Forks
103
PR merge metrics
No merged PRs in 30d

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

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the report with NetSparkleUpdater.UI.WinForms.NetFramework v3.1.0 in a VB WinForms project using VS2026 and a Task.Run async lambda. Compare compilation with and without the NetSparkle reference, then inspect the reported Microsoft.CodeAnalysis.VisualBasic.AsyncRewriter failure. Done means establishing whether NetSparkle can provide a workaround or whether the failure belongs upstream in the VB compiler.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, visualbasic
Domain
compilers, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.