I have the exact same problems
Dim somedata = jsonHelper.GetPostorDeleteBasedOnPostAndRealBodyData(payLoadString)
Dim getdeleteorpost = somedata.Item1
Dim usedPayloadString = somedata.Item2
works fine
but
Dim (getdeleteorpost, usedPayloadString) = jsonHelper.GetPostorDeleteBasedOnPostAndRealBodyData(payLoadString)
doesn't work
I tried to look around and find this question.
According to chatGPT. VB.net simply doesn't support this.
So your solution for now is to just use this syntax
Dim somedata = jsonHelper.GetPostorDeleteBasedOnPostAndRealBodyData(payLoadString)
Dim getdeleteorpost = somedata.Item1
Dim usedPayloadString = somedata.Item2
Excerpts from my ChatGPT conversation. I am sure it insists it works for VB 15.3+. But now it changes it's mind.
So noone can do VB.NET tuple deconstruction syntax yet
Correct — VB.NET does not support tuple deconstruction syntax like:
vb.net
CopyEdit
Dim (x, y) = GetTuple()
Even in the latest .NET versions (including .NET 9), VB.NET’s language features have remained mostly frozen, and that syntax has never been added.
You can still use tuples — just not with deconstruction:
vb.net
CopyEdit
Dim result = GetStuff() Dim x = result.Item1 Dim y = result.Item2
Or, for better clarity:
vb.net
CopyEdit
Public Function GetStuff() As (name As String, age As Integer) Return ("Alice", 30) End Function
Then access with:
vb.net
CopyEdit
Dim person = GetStuff() Console.WriteLine(person.name) Console.WriteLine(person.age)
✔️ Named tuple fields work.
❌ Deconstruction doesn’t.
Microsoft has shifted VB.NET into maintenance mode. That means:
No major new language features.
Still supported and maintained.
Works fine with .NET Core/.NET 5/6/7/8/9.
But no new syntax like pattern matching, tuple unpacking, etc.
If you ever switch to C#, you can do tuple deconstruction — but for now, in VB.NET, you’re stuck with Item1
, or named fields only. Let me know if you'd like the C# equivalent or tips on making VB.NET cleaner.