toddams / RazorLight

Template engine based on Microsoft's Razor parsing engine for .NET Core
Apache License 2.0
1.5k stars 259 forks source link

QUESTION: Is it possible work with vbhtml files? #495

Closed JBypass closed 1 year ago

JBypass commented 1 year ago

Hello,

The tool works great, but I have a project in vb and, although it works well too, I can't work with views in vbhtml, I have to change to cshtml.

It is not a major problem, but I have a lot of emails templates in vbhtml that I would have to convert to C# and I think that I would lost the intellisense.

It is possible work with vbhtml files?

Many thanks for the tool and for the help!

jzabroski commented 1 year ago

I... don't know. I suppose since Roslyn supports VB.NET, then it is possible but you might have to dig to make it work. I am personally not interested in supporting VB.NET, since I have never had that request in 4 years of doing this and don't see it as an in-demand technology.

But you would basically be replacing a bunch of stuff, for example, all the C#-specific stuff is private variables in RazorLight's RoslynCompilationService class:

https://github.com/toddams/RazorLight/blob/c7f97d6d16091046e908b7764a712d69f12767a1/src/RazorLight/Compilation/RoslynCompilationService.cs#L71-L72

You could add a PR for this but please be sure to cover it with tests. Quite a bit of work if you ask me.