RooksStrife
RooksStrife

Reputation: 1747

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?

Upvotes: 2

Views: 1163

Answers (1)

Jonathon Chase
Jonathon Chase

Reputation: 9704

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#

Upvotes: 7

Related Questions