VB.NET Support In .NET Core – The State Of Play In 2019

Let me start off by saying, I am not a VB.NET developer by any means. Infact I would go as far to say that I never really learned Visual Basic and I only delve into it when I really have to.

As I write this, it’s one of those times when I have to. I’m supporting a few legacy platforms written in VB.NET at a large enterprise company. And as the world moves to .NET Core, I was looking to an upgrade path where we can bring along the existing legacy apps without re-writing the lot. If you are currently writing VB.NET, you should seriously think about moving to C#. It’s not a slight on VB.NET as a language, but more reading between the lines as to how Microsoft has treated it in recent years.

Web Development

Let’s get the elephant in the room out of the way immediately. There is zero support for any web development in VB.NET on the .NET Core platform. That includes MVC, Web API, Razor Pages and WebForms (Although WebForms aren’t getting the .NET Core treatment ever – MS have instead been pushing Razor Pages as an alternative).

This essentially means if you want to use .NET Core as your web platform of choice, you will be required to learn C#.

Class Libraries

VB.NET is supported for both .NET Core and .NET Standard class libraries. This means that if your web application has different layers such as a service/data access layer, then you will only be required to re-write the web front end in C# and you can keep VB.NET as your class library language.

Desktop Development

Strangely, WPF, Winforms and Console applications are all able to be written in VB.NET with .NET Core 3+. I say strangely because to go to the effort of porting desktop GUI applications to .NET Core that then supports VB.NET but then not do the same for web could be seen as an odd move. But at a guess, I suspect the numbers of VB.NET Web applications that are not using ASP.NET WebForms to actually be a low number – and since that isn’t getting ported even for C#, I can see why they just didn’t bother. However things like WinForm development has often been written using VB.NET since release, so it’s coming along for the ride (for now!).

Other Key Notes

  • C# and VB.NET Interop is still high on Microsoft’s priority list, that means if fundamental changes to the C# language (Default class implementations) are added, this will be added to VB.NET also.
  • Microsoft have expressly said that not all .NET Core API’s will be available for VB.NET, especially those that give low level control to programmers.
  • Visual Basic 16 will ship together with C# 8
  • Microsoft’s meeting notes on the future of the VB language are up on Github here : https://github.com/dotnet/vblang
ENJOY THIS POST?
Join over 3.000 subscribers who are receiving our weekly post digest, a roundup of this weeks blog posts.
We hate spam. Your email address will not be sold or shared with anyone else.

4 comments

  1. You’re correct. I believe that if Visual Basic .NET (VB.NET) were supported on Blazor and Xamarin Forms a lot of VB programmers will use these technologies. It’s hard to fathom that Microsoft, with its enormous resources, would not allocate resources to support VB.NET on these web/mobile technologies.

    One truly gets the feeling that Microsoft doesn’t believe that VB programmers wish to develop on these web and mobile platforms, which is a shame because this could not be further from the truth.

    I suspect that the popularity of JavaScript makes Microsoft devote tremendous effort to keep C# relevant. It’s interesting that, despite the significant resources focused on C# by Microsoft it still lags behind VB.NET in popularity (as at May 2019) in the TIOBE Index: http://statisticstimes.com/tech/top-computer-languages.php.

    Imagine if VB.NET were supported on Blazor and Xamarin – I believe it’s popularity would rival JavaScript!

    Microsoft may be making a mistake following JavaScript around (Microsoft even created TypeScript for crying out loud!) instead of leading the world with Visual Basic .NET!

  2. What exactly is not supported in the case of web development? the web API application is a console application. It can be easily converted to vb and runs, so what I am not getting?

    1. A very very simple implementation like returning a simple model may work OK, but things like trying to use a view file will instantly break. Since I wrote this I actually had to investigate further around VB.NET Support, so Idid some more digging. Here’s a few more links to peruse if you are interested.

      Feature Request on Github for VB.NET Support in MVC/Razor : https://github.com/aspnet/AspNetCore/issues/2738
      Open Source Project to support VB.NET Razor : https://github.com/VBAndCs/Vazor
      Original MS Post got updated around VB.NET Desktop Support : https://devblogs.microsoft.com/vbteam/visual-basic-in-net-core-3-0/

      1. so if you don’t need view (because does not support .vbhtml files) you are good to go. In my case, I don’t need view I just need controllers. If it’s a react website or just a web api app. those don’t need view.

Leave a Reply

Your email address will not be published. Required fields are marked *