New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Basic .NET (VB.NET) support in ASP.NET Core #2738

Closed
reduckted opened this Issue Jan 3, 2018 · 67 comments

Comments

Projects
None yet
@reduckted
Copy link

reduckted commented Jan 3, 2018

There have been many questions asked about VB.NET support in ASP.NET Core over the past few years. If you follow them, they all lead to dead-ends - either closed with no real response, or they're moved to other repositories that are unrelated to ASP.NET Core (such as somewhere in the dotnet organization).

Over that time, there's been talk of supporting VB. It's completely understandable that ASP.NET Core didn't support VB from the outset. The project was going through a lot of rapid change, so it made sense to focus on C# initially and add support for other languages later. But the idea of supporting VB seemed to get lost along the way.

Here's a brief timeline:

Dec 16, 2014:

We plan to have extensibility points so other languages like VB, F#, etc can be added via the form of a support package or such.
#236 (comment)

Apr 25, 2015:

Hey everyone, good news! We've announced plans to support VB in ASP.NET 5 / DNX!
#236 (comment)

We are excited today to announce that ASP.NET 5 will have full support with Visual Basic (both tooling and runtime – including cross platform runtime support).
https://blogs.msdn.microsoft.com/webdev/2015/04/24/making-it-better-asp-net-with-visual-basic-14/

Nov 19, 2016:
VB Support disappears from the roadmap:

 |1.0.4|Feb 2017|
 |1.2|Q2 2017|
 
-## Future Work
-
-Visual Basic support.
-
 <em><sup>*</sup> References to yearly quarters (Q1, Q2, Q3, Q4) are calendar-based</em>

https://github.com/aspnet/Home/wiki/Roadmap/_compare/2138fe4ff8a437e8edefc333189aaa8d9b5afb6a...b49bda1f8f40975b39d14d199a9ddac0a2beb45e

Dec 12, 2017:

there are no plans to add a VB template for ASP.NET Core
#2305 (comment)

VB support seems to have gone from

"It doesn't work yet, but we plan to allow VB"

to

"There will be full support for VB!"

to

"VB is not supported, but shhh, don't tell anyone".

So my first question is:

What happened and why was there no announcement or discussion with the community about this?

It seems strange to go from announcing support for VB.NET in ASP.NET Core in an official blog post, to not supporting it at all without any feedback. Was there any announcement about this? If there was, it certainly wasn't widely published.

My next, and more important question is:

What can the VB community do to help add support for VB.NET to ASP.NET Core?

Are there project templates that we can write?
Are there code generators that we can implement?
What can we do make ASP.NET Core as awesome for VB developers as it is for C# developers?


I've thrown together a simple ASP.NET Core app (link deleted because the repo is out of date) in VB by creating a .NET Core console application, editing the project file and copying the classes generated from the ASP.NET Core C# template. It works fine, and even though it's only very basic, I can't see any reason why VB.NET cannot be supported.

@muratg

This comment has been minimized.

Copy link
Member

muratg commented Jan 3, 2018

@hishamco

This comment has been minimized.

Copy link
Contributor

hishamco commented Jan 3, 2018

I logged an issue long time back to use VB alongside with .cshtml in Razor repo, since then I didn't see any action 😟.
Few weeks ago I saw a great example from @DamianEdwards that demonstrate a hyprid VB ASP.NET Core application here

@Eilon Eilon added this to the Discussions milestone Jan 4, 2018

@tb-mtg

This comment has been minimized.

Copy link

tb-mtg commented Jan 11, 2018

In addition to @reduckted excellent summation, Microsoft's documentation for Razor syntax for ASP.NET Core (as at 2017-10-18) still has numerous references to Visual Basic and using .vbhtml files:

This restriction doesn't apply to .vbhtml Razor files because Visual Basic syntax places parentheses around generic type parameters instead of brackets.

However ScottAddie@MSFT had posted a comment on 2017-07-21:

ASP.NET Core doesn't yet support VB.NET. You'll need to stick with ASP.NET proper for now.

So is Visual Basic/vb.net/.vbhtml files going to be included in .Net Core? And If so when??

@brunojuliao

This comment has been minimized.

Copy link

brunojuliao commented Jan 14, 2018

How can we help to make this support happen? I would love to see VB.Net and F# support!

@Eilon

This comment has been minimized.

Copy link
Member

Eilon commented Jan 18, 2018

I sent a PR to remove the VBHTML references from the ASP.NET Core docs: aspnet/Docs#5201

There are currently no plans to introduce VBHTML support to ASP.NET Core.

We do have F# templates for ASP.NET Core, which are installed as part of the .NET Core SDK.

@reduckted

This comment has been minimized.

Copy link
Author

reduckted commented Jan 18, 2018

@Eilon There are currently no plans to introduce VBHTML support to ASP.NET Core.

Personally, I'm not concerned about VBHTML support because I don't use Razor pages, and don't intend to. As mentioned by @AnthonyDGreen (dotnet/vblang#238 (comment)), it doesn't make sense to add VB support to it because it was rarely used in MVC 5, and, I imagine, would take a very large amount of work for not a lot of gain.

@Eilon We do have F# templates for ASP.NET Core, which are installed as part of the .NET Core SDK.

OK, but I'm not really sure what your point is here. If anything, doesn't this just reinforce the fact that there should be VB templates as well?

Weren't the F# templates created by the F# community? If the team at Microsoft won't create VB templates, then why can't the VB templates be created by the VB community?

@Eilon

This comment has been minimized.

Copy link
Member

Eilon commented Jan 18, 2018

@reduckted the question comes down to the demand for it and the cost of it - both the initial cost and the ongoing cost. The demand has been very low, as noted earlier. The cost to create an initial set of templates might not be much, but someone has to maintain them. With F# we have people at Microsoft who are committed to maintaining them. We don't have any such people for VB at this time.

Also, one limitation with the F# templates is that they focus more on the API side of things; that is, no Razor or CSHTML (because there's no FSHTML). With VB users my guess is that most users using VB would be expecting a VBHTML experience for MVC, and the cost of producing that is enormous - months and months of work. So, it isn't clear to me that adding limited VB templates would be particularly valuable.

@reduckted

This comment has been minimized.

Copy link
Author

reduckted commented Jan 19, 2018

@Eilon With VB users my guess is that most users using VB would be expecting a VBHTML experience for MVC...

You may want to speak to @AnthonyDGreen, because that's exactly the opposite of what he has said in the comment that I previously linked to (dotnet/vblang#238 (comment)). I'll quote it this time (emphasis is mine):

The .vbhtml razor engine from MVC 5 wasn't ported to Core primarily because less than 1% of all VB web projects used it after 5 versions.

@Eilon

This comment has been minimized.

Copy link
Member

Eilon commented Jan 19, 2018

@reduckted - interesting, that is news to me. I'm thinking back to Web Forms days, which was initially designed with concepts that were familiar to VB developers (VB6, specifically), and Web Forms was very HTML-centric (sorta), so that led me to think that VBHTML would be most interesting to that group of people. Then again, that's ~15 year old anec-data 😄

BTW to be clear, we haven't said that we're never going to do it - just that it isn't currently in any plans.

@hishamco

This comment has been minimized.

Copy link
Contributor

hishamco commented Jan 19, 2018

I'm a VB fan 😄, which I expect .vbhtml to be out-of-the-box, the hybrid approach that I mentioned before is not enough for all the VB guys, but It's fine is some cases. My question is some re-implement the Razor to emit VB instead of C# is that gonna work, or the MVC is tightly coupled on the cshtml C#?

@KathleenDollard

This comment has been minimized.

Copy link

KathleenDollard commented Feb 4, 2018

@hishamco Unfortunately Razor was implemented so that VB and C# were separate paths. I've talked to a few people involved and it's quite a large project.

@tb-mtg

This comment has been minimized.

Copy link

tb-mtg commented Feb 4, 2018

@KathleenDollard There are other .NET Core projects that support custom ViewEngines for .pug & .md file types.

Surely we can make it work for .vbhtml razorpages files using a .vbproj with <Project Sdk="Microsoft.NET.Sdk.Web">.

@KathleenDollard

This comment has been minimized.

Copy link

KathleenDollard commented Feb 4, 2018

@tb-mtg It's all open source if you want to explore it and see what those projects did. The folks that wrote it told me it was a big effort. The size of the effort and the exceedingly low adoption of vbhtml in earlier versions of MVC make it a hard sell.

@hishamco

This comment has been minimized.

Copy link
Contributor

hishamco commented Feb 5, 2018

@KathleenDollard I will repeat my question again, If I re-implement the Razor to emit VB instead of C# is that gonna work, or the MVC is tightly coupled on the cshtml C#?

@Eilon

This comment has been minimized.

Copy link
Member

Eilon commented Feb 5, 2018

@hishamco that would be a good question for @rynowak . Ryan?

@rynowak

This comment has been minimized.

Copy link
Member

rynowak commented Feb 5, 2018

MVC's runtime compilation engine uses the Roslyn infrastructure for compiling C#, and expects/requires the C# project system's settings to be passed through .deps.json. MVC doesn't have any tight coupling to the code that is generated, but rather it provides infrastructure for compiling C# views at runtime using settings generated by a C# project.

Anyone who wants to compile VB at runtime will need to implement a view engine that does that.

@hishamco

This comment has been minimized.

Copy link
Contributor

hishamco commented Feb 5, 2018

Thanks @rynowak for you clarification

uses the Roslyn infrastructure for compiling C#, and expects/requires the C# project system's settings to be passed through .deps.json

If I implement a VB view engine - or clone C# one with modification -, what settings that I need to pass into .deps.json to make this happen?

@CheungTatMing

This comment has been minimized.

Copy link

CheungTatMing commented Feb 17, 2018

+1
Visual Basic always the most important language in .NET world. VB still many fans and use today! Although many peoples work in C# project on their work place, but I believe many peoples like me, love to use VB on own project.

@tb-mtg

This comment has been minimized.

Copy link

tb-mtg commented Feb 26, 2018

@AnthonyDGreen @KathleenDollard

The .vbhtml razor engine from MVC 5 wasn't ported to Core primarily because less than 1% of all VB web projects used it after 5 versions.

What do the other 99% use then?

@reduckted

This comment has been minimized.

Copy link
Author

reduckted commented Feb 26, 2018

Angular, or other similar front-end libraries, I would presume. That's what I use.

@VBDotNetCoder

This comment has been minimized.

Copy link

VBDotNetCoder commented Mar 4, 2018

Actually that is also exactly what I plan to do with our new web projects move to Angular from ASP.Net MVC Razor , I have to do 4 new web projects this year , so if someone keeps count .. LOL

@simonmilne80

This comment has been minimized.

Copy link

simonmilne80 commented Mar 5, 2018

VB has been a popular language for many years! As a company we certainly have many code snippets that we would not want to have to re-write in C# Im sure there are many old school web form apps that are due to be re-written especially with the new EU rules coming into play, this would mean that VB would be very much wanted! I find it amazing that microsoft blow so hot and cold on VB one minute its being developed on par, next its the poor relative! Yes new languages and frameworks are coming out but dont just ditch the popular old ones!

@tb-mtg

This comment has been minimized.

Copy link

tb-mtg commented Mar 18, 2018

Glad it's being tracked here, hopefully might see some action then.

@NatShaw

This comment has been minimized.

Copy link

NatShaw commented Jun 6, 2018

All signs (weasel words) from MS are that they plan to dumb-down VB.NET, and/or do nothing and wait for others to write the missing bits. I’m over their weasel words, I’m exiting VB.NET development now.

@tb-mtg

This comment has been minimized.

Copy link

tb-mtg commented Jun 6, 2018

I just hope when Microsoft acquires GitHub it doesn't get the same treatment that VB.Net did (being left for dead with empty promises of full support).

@KathleenDollard

This comment has been minimized.

Copy link

KathleenDollard commented Jul 3, 2018

I haven't looked at the Razor code to know whether it directly builds a syntax tree, but assuming it does...

Roslyn works with specific, explicit, raw syntax trees that are different for C# and VB. For example, sei-colon and curly braces exist in C#, not VB. End Sub and Handles exist in VB and not the C# syntax tree.

@mcurros

This comment has been minimized.

Copy link

mcurros commented Jul 3, 2018

@KathleenDollard

Yes I understand project blazor is experimental, but it compiles to web assembly and it's an easier way to do cross-platform apps (sharing existing code on server and clients, I happen to like windows server and ASP .NET so I prefer running a server that supports the full .NET framework to reuse our existing code base).

As for your questions:

  1. .NET core 3 does not make WinForms apps cross platform, so it doesn't add too much.

  2. I'm rewriting for the web because it makes our apps cross-platform. We are using an ASP .NET controller to share the existing code, so on the server we have no problems. As I said, we are using our own framework, which is starting to provide the same functionality in JS, but we need to re-write the client code again, and test it, and the UI is still taking at least 80% of development time.

  3. We started to port our framework to JS before project blazor. Rewriting in C# will not make our client app cross-platform, it will require to target the browser anyway or convert to Xamarin or something else, so the effort is the same.

I program in C, C++, C#, VB, JS and know how to use several stacks, but we have several members in our team that will struggle to convert to another language. Anyway, the point is to reuse our tested code base, not to rewrite it. If blazor could compile VB in views it would save us a lot of time, that's all.

Also it's weird for users to understand that they could compile razor views before in VB .NET with the full framework. It just looks like you left behind VB. And all started with .NET core, wasn't first an experimental project?

To add a little more context we are porting three mission critical ERPs, for different line of business.

Regards.

@KathleenDollard

This comment has been minimized.

Copy link

KathleenDollard commented Jul 3, 2018

@mcurros

Thanks for sharing more about your scenario.

The Razor engine was rewritten for ASP.NET Core and that is where the effort for multiple languages was not made. Low usage of the VB version of the Razor engine was one of the driving factors. And yes, the existence of Blazor makes that decision quite painful.

@mcurros

This comment has been minimized.

Copy link

mcurros commented Jul 3, 2018

@KathleenDollard

Thank you Kathleen for sharing the insights. I hope languages in .NET don't start competing against each other, one of the most appealing things with .NET was the languages and interoperability between them, now it seems that would no longer be the case. Now it's not enough to choose .NET as a development stack, I guess we will need to be careful about the languages we choose, too. Pity, it feels like a step backward.

On e last question, though, I think razor was written well before .NET core, with ASP .NET webpages and webmatrix, so I think you mean that the razor engine was re-written in .NET core targeting C#. Am I right?

Best of luck.

@filippobottega

This comment has been minimized.

Copy link

filippobottega commented Jul 4, 2018

Hello,
I have found this post: Why not Razor?.
What do you think about avoiding completely the use of Razor syntax in ASP .NET Core and Blazor projects in favor of a pure C# and VB.NET development? Are we sure that we need Razor syntax to develop web applications that need to emit HTML5 and CSS files?

Regards,
Filippo.

@mcurros

This comment has been minimized.

Copy link

mcurros commented Jul 5, 2018

@filippobottega

Oh well that was before blazor. The problem is that you need a templating engine at the client, and in the case of blazor is just that. In blazor razor is executing in the browser not the server (but it could execute at the server if needed). So, people are trying to share code between client and server in the browser for ages. Sharing validation code will be a simple case, but in our case we share metadata describing models so components can configure themselves using that metadata.

Node.JS has become popular because you can share code between the browser and the server. So why not share .NET code between browser and server? Razor gets compiled to a webassembly with your shared code, and that's it. Yes, you could compile and run and distribute your app, but the browser has better crossplatform capability and you will target more platforms with the same code. I have also seen WPF compiled to webassembly if you wish to go that way.

We prefer to take advantage of the existing JS components and mix them with our .NET base, but we prefer .NET and razor as a replacement for other JS frameworks, like angular. It's 10x more productive if you know what your are doing, at least for us.

Regards.

@KathleenDollard

This comment has been minimized.

Copy link

KathleenDollard commented Jul 5, 2018

@mcurros Yes, a great deal was reworked/rewritten in ASP.NET Core (look at the pipeline model as an example), including Razor.

@filippobottega

This comment has been minimized.

Copy link

filippobottega commented Jul 5, 2018

@mcurros Ok, it's true that we need a template engine but the problem is that the Razor syntax is not supported by a solid WYSIWYG designer.
For example Blazor uses Bootstrap as CSS library. There is a interesting designer for Boostrap named Bootstrap Studio but it doesn't support Razor syntax.
For WinForms desktop applications, there is a good WYSIWYG designer to quickly design interfaces, for XAML the same. There is a designer we may use to quickly create HTML5-CSS with Razor syntax views (.cshtml/.vbhtml) ?

@mcurros

This comment has been minimized.

Copy link

mcurros commented Jul 7, 2018

@filippobottega
As the devices that can run browsers are in the 10K order, I think that making an accurate WYSIWYG tool does probably not worth the effort. The trend these days is to run it in the browser and let the browser make the rendering. Blazor samples use Bootstrap, but razor is a templating engine, you can emit what you want and the CSS/HTML framework you like. The interesting parts are, the compilation to webassembly, and the modified razor to provide SPA routing, and all the things you need to build an SPA client. Plus if needed you can render that at the server (for public websites and search engine indexing). I think it's pretty cool.

So blazor provides real time webassembly compilation and run in browser hitting F5. It's fast, try it.

@filippobottega

This comment has been minimized.

Copy link

filippobottega commented Jul 9, 2018

@mcurros Thank you for your answer. I agree with you even if I think the possibility to change the templates structure with drag and drop using the browser preview may be really useful.
If think about a developer preview where components have the ability to be moved, resized and embedded in other components with drag end drop, finally updating the CSHTML template.
For example Concrete5 let you change the layout on the fly.
Let me know if you think that a "design mode" will be feasible in the future.

Best regards,
Filippo.

@mrjohnr

This comment has been minimized.

Copy link

mrjohnr commented Jul 28, 2018

I don't think will be a future for VB:
Microsoft's new strategy to end the co-evolution of C# and Visual Basic will make it even less respected by developers
C# is the future for .Net developers, so it's time to limit Visual Basic's use to on-premises legacy systems

https://www.infoworld.com/article/3167210/application-development/visual-basic-is-the-odd-man-out-in-the-new-net.html

https://www.infoworld.com/article/3254564/application-development/doing-nicely-now-visual-basics-popularity-could-take-a-hit.html
https://blogs.msdn.microsoft.com/dotnet/2017/02/01/the-net-language-strategy/

@beefydog

This comment has been minimized.

Copy link

beefydog commented Aug 16, 2018

250 million lines of code, half of which is still in use, now must be rewritten. VB.Net got killed due to the latest generation of programmers complete ignorance of the language itself (and all the idiots that kept comparing it to Visual Basic - Apples to Oranges) with absurdly false comparisons in performance and other vectors. RIP VB.Net and the millions of developers that will lose their jobs as a result.

@mevdschee

This comment has been minimized.

Copy link

mevdschee commented Aug 18, 2018

Like @DamianEdwards, I ported the example "ASP.Net Core Web Application" from C# to VB. It is (successfully) using Razor .cshtml files in a VB project. I have ensured it is compatible with ASP.Net Core 2.1. You can find it here:

https://github.com/mevdschee/aspnetcorevb

@hishamco

This comment has been minimized.

Copy link
Contributor

hishamco commented Aug 18, 2018

@marcusoftnet Damian example is cool to use .cshtml for views and the rest of the app in VB.NET, but it will very cool to use the .vbhtml for the views 😃

@Baner041986

This comment has been minimized.

Copy link

Baner041986 commented Oct 25, 2018

Yo no se que tiene Microsoft en la cabeza, teniendo en las manos un Lenguaje de Programación como VB pudiendo apropiarse en la Web de los dos ambitos del lado del cliente y de lado del servidor

cliente: vbscript
servidor: vb

Pulir VB es algo que los beneficiaria, es comprensible, entendible y adaptable, realmente da mucha lastima y nostalgia saber que vb.net no está en la web, pero es culpa de ustedes y centrarse solo en uno

Bing translation:
I do not know that has Microsoft in the head, having in the hands a programming language like VB being able to appropriate on the Web of the two areas of the client side and server side

Client: VBScript
Server: VB

Polishing VB is something that the beneficiary, is understandable, understandable and adaptable, really gives a lot of pain and nostalgia to know that vb.net is not on the web, but it is your fault and focus only on one

natemcmaster pushed a commit that referenced this issue Nov 15, 2018

Merge pull request #2738 from dotnet-maestro-bot/merge/release/2.2-to…
…-master

[automated] Merge branch 'release/2.2' => 'master'
@tb-mtg

This comment has been minimized.

Copy link

tb-mtg commented Nov 16, 2018

@hishamco

This comment has been minimized.

Copy link
Contributor

hishamco commented Nov 16, 2018

This will let VB.NET continue to be supported to add the features that's already added in C#, but again no vbhtml 😕

@KathleenDollard

This comment has been minimized.

Copy link

KathleenDollard commented Nov 18, 2018

@hishamco No. While I share your :( the Razor engine supports C# only.

@hishamco

This comment has been minimized.

Copy link
Contributor

hishamco commented Nov 19, 2018

Razor engine supports C# only

That's what I meant 😄

@hannespreishuber

This comment has been minimized.

Copy link

hannespreishuber commented Jan 9, 2019

Tibor Index Shows VB.NET growing, anyway we Need vb razor

@Webbarrr

This comment has been minimized.

Copy link

Webbarrr commented Jan 16, 2019

Like @DamianEdwards, I ported the example "ASP.Net Core Web Application" from C# to VB. It is (successfully) using Razor .cshtml files in a VB project. I have ensured it is compatible with ASP.Net Core 2.1. You can find it here:

https://github.com/mevdschee/aspnetcorevb

@mevdschee I'm curious as to the process you went through for porting it over into VB.NET as the project template isn't available through Visual Studio / no support in VSCode. How did you go about doing this?

@mevdschee

This comment has been minimized.

Copy link

mevdschee commented Jan 16, 2019

@Webbarrr I converted the C# code to VB by hand and used the Visual Studio C# template to start from.

@MohammadHamdyGhanem

This comment has been minimized.

Copy link

MohammadHamdyGhanem commented Feb 14, 2019

@reduckted @hishamco @muratg @tb-mtg @brunojuliao @Eilon @rynowak @CheungTatMing @VBDotNetCoder @simonmilne80 @NatShaw @SrqComputerguy @sreenathGanga1988 @mcurros @filippobottega @mrjohnr @beefydog @mevdschee @Baner041986 @hannespreishuber @Webbarrr

I agree that vbhtml is a lost cause, because VB.NET code doesn't fit well amoung HTML, CSS and JavaScript syntax! Instead, I ask for vbxaml !
I posted this suggestion in VB.NET repo months ago:
dotnet/vblang#329
These are quotes:

Let VB.NET ride the new WebAssembly wave:
After WebAssembly and Blazor, the opportunity represents itself: It is logical now to write XAML instead of HTML5 (differences are minimal) and write VB.NET instead of Java script (the same way C# replaces Java now in Blazor).
There is already a project named Ooui trying to do that in C#.
I think, VB.NET should do the same, and have a project to design ASP.NET pages with XAML and VB.NET code, making use of the work done in SilverLight, Blazor and Ooui. If this starts now, it can grow steadily, instead waiting for Blazor and Ooui to stable and then MS say:
Sorry, it will be expensive for VB.NET to catch up!

VBlazor (.vbxaml) will make desktop developers experienced in VB.NET and WPF/UWP move to ASP.NET smoothly.

@hishamco

This comment has been minimized.

Copy link
Contributor

hishamco commented Feb 14, 2019

IMHO using XAML or templating language such as Fluid will make all happy, because the Razor is written for C# only

@MohammadHamdyGhanem

This comment has been minimized.

Copy link

MohammadHamdyGhanem commented Feb 14, 2019

VBLazor would be similar to uwp/wpf design view, but with two code-behind files, one for server vb.net codes, and another for client (script) codes, with the ability to use MVVM pattern to organize large projects. XAML will be complied to html5, Xaml styles will be compiled to CSS, and VB.NET script codes will be compiled to WebAssembly.

@reduckted

This comment has been minimized.

Copy link
Author

reduckted commented Feb 14, 2019

I'm closing this because, sadly, it's pretty clear that there is no intention to add VB.NET project templates for ASP.NET Core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment