Results 1 to 11 of 11

Thread: Blazor and VB.NET

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2016
    Location
    Fairbanks, Alaska
    Posts
    18

    Blazor and VB.NET

    I'd like to write my Blazor controllers in VB.NET.

    I seem to recall some time ago coming across a hybrid ASP.NET sample app that someone had put together that ran its startup functions in C# but then quickly transitioned everything to VB. Alas, I'm not able to find it again. There's this technique, but it applies to the older ASP.NET Core—in fact you can't even install the old Microsoft.AspNetCore.All package—and we're all the way on .NET 6 by now.

    Does anyone have any suggestions?

    Thanks,
    Jeff Bowman
    Fairbanks, Alaska

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,336

    Re: Blazor and VB.NET

    I would think that your only option would be to write C# code that calls library methods written in VB.

  3. #3
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,599

    Re: Blazor and VB.NET

    When last I checked, Blazor is not supported in VB.Net, only C#. If you want to force the issue, you might be in for a world of pain.

    Thankfully though, like any .Net solution, you can mix VB.Net and C# projects in the same solution. You should be able to write a lot of backend stuff in VB.Net.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  4. #4

    Thread Starter
    Junior Member
    Join Date
    May 2016
    Location
    Fairbanks, Alaska
    Posts
    18

    Re: Blazor and VB.NET

    Quote Originally Posted by jmcilhinney View Post
    I would think that your only option would be to write C# code that calls library methods written in VB.
    That was my first thought as well.

    I'll keep looking for a way to defeat that limitation. If I find one I'll report back here.

    Thanks,
    Jeff Bowman
    Fairbanks, Alaska

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2016
    Location
    Fairbanks, Alaska
    Posts
    18

    Re: Blazor and VB.NET

    Quote Originally Posted by Niya View Post
    You should be able to write a lot of backend stuff in VB.Net.
    That'll get me by until I find a way to do it directly.

    Thanks,
    Jeff Bowman
    Fairbanks, Alaska

  6. #6
    New Member
    Join Date
    Jan 2019
    Posts
    10

    Re: Blazor and VB.NET

    Hi Jeff, as far as I know until the second I reply to this thread, blazor is still specific to c#, although we can make Progam.vb but the rest like razor page, razor view and razor component are still special for c# so they can be compiled

    I'm quite surprised why you're interested in blazor, something that's still new. Most developers have years of experience with javascript and its libraries/frameworks, so they don't need web assembly. And who else will know that Blazor can be successful? I think you also know that the UWP, which has been around for a long time, has not been successful, especially since the 'death' of Windows Phone. The same I think also applies to NET. MAUI

    And VB can be used for ASP.Net Core MVC/Web API projects. Including most of the minimal APIs introduced by NET 6. If I have time, maybe I'll create a thread about why we stick with VB and can still exist without having to 'switch' to c#

  7. #7
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,535

    Re: Blazor and VB.NET

    Quote Originally Posted by djancuk View Post
    The same I think also applies to NET. MAUI
    Really? You think MAUI is "dead"? I'm not so sure. Especially since it hasn't been actually released yet. It's close though. The problem with UWP is that it was aimed at the Windows ecosystem exclusively. That's why it's dead. MAUI on the other hand has been done from the ground up, base on Core, and is intended to be cross-platform from the get-go, rather than as an after-thought. My only consternation on it is that it doesn't (yet) include support for Linux system, but it is what it is I guess.


    As for switching to C# ... if you're fluent in VB.NET ... it's not really that difficult.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,470

    Re: Blazor and VB.NET

    Quote Originally Posted by djancuk View Post
    I'm quite surprised why you're interested in blazor, something that's still new. Most developers have years of experience with javascript and its libraries/frameworks, so they don't need web assembly
    WASM is generally faster than Javascript, can be a strongly typed language e.g. C#, and doesn't rely on the current Javascript ecosystem of npm packages, webpack etc. as far as I am concerned these are all good reasons to consider it rather than JAvascript.

  9. #9
    New Member
    Join Date
    Jan 2019
    Posts
    10

    Re: Blazor and VB.NET

    Quote Originally Posted by techgnome View Post
    Really? You think MAUI is "dead"? I'm not so sure. Especially since it hasn't been actually released yet. It's close though. The problem with UWP is that it was aimed at the Windows ecosystem exclusively. That's why it's dead. MAUI on the other hand has been done from the ground up, base on Core, and is intended to be cross-platform from the get-go, rather than as an after-thought. My only consternation on it is that it doesn't (yet) include support for Linux system, but it is what it is I guess.


    As for switching to C# ... if you're fluent in VB.NET ... it's not really that difficult.

    -tg
    I mean NET. MAUI is the same as Blazor, still new. There is no guarantee of success as with WinForms, ASP.NET MVC/Web API, and success I mean widely used.

    Regarding 'switching' to c#, maybe in a different thread we will discuss

  10. #10

    Thread Starter
    Junior Member
    Join Date
    May 2016
    Location
    Fairbanks, Alaska
    Posts
    18

    Re: Blazor and VB.NET

    Quote Originally Posted by techgnome View Post
    As for switching to C# ... if you're fluent in VB.NET ... it's not really that difficult.
    Working in C# helps me appreciate VB all that much more 🙂

  11. #11

    Thread Starter
    Junior Member
    Join Date
    May 2016
    Location
    Fairbanks, Alaska
    Posts
    18

    Re: Blazor and VB.NET

    Quote Originally Posted by djancuk View Post
    I'm quite surprised why you're interested in blazor, something that's still new.
    Because it works today and it fits the bill for an app I'm building.



    Quote Originally Posted by djancuk View Post
    ... maybe I'll create a thread about why we stick with VB and can still exist without having to 'switch' to c#
    Sure, sounds interesting.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width