Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.Net comments cause VS Code syntax highlighting to stop working

VS Code screenshotMy .ascx file contains C# and HTML. Everything in VSCode is highlighting the syntax correctly up until it reaches <%-- insert dynamically generated text here --%>. After that, everything is white like text. All HTML/other code doesn't highlight and IntelliSense stops working. How do you stop VSC from doing this?

like image 859
RooksStrife Avatar asked Aug 04 '26 07:08

RooksStrife


1 Answers

It looks like the default razor syntax included with the C#/Omnisharp plugin doesn't cover the older razor syntax that's used with WebForms, so it has no idea what to do when it comes across code nuggets.

The following extension can be installed to help add in support for WebForms' ASPX pages and older razor syntax.

HTML C#

like image 98
Jonathon Chase Avatar answered Aug 06 '26 00:08

Jonathon Chase



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!