ASP.NET .cshtml colors not working (even if changing theme)

Answered

Hello everyone, good morning.

I'm using Rider with an Asp.Net MVC 5 project. It's all working pretty well except for the .cshtml files.

No matter what i do or change in the settings the HTML and Razor syntax are not getting highlighted.

I'm using Visual Studio Light Theme.

See picture bellow:

It is like i'm on Windows Notepad, with no styling at all :(

The intellisense is working fine, i just need to fix this color issue.

Any help would be appreciated.

Thanks!

8 comments
Comment actions Permalink

Hi Rafael,

Do you have a pause icon on the editor's top-right corner? If so, what does the message say?

0
Comment actions Permalink

Hi Julia,

Yes, there is a pause icon.

Here's a picture of what it says:

And when i right-click it, the following appears:

Thanks!

 

0
Comment actions Permalink

Hello guys, 

I have same problem, what is the solution?

0
Comment actions Permalink

Same problem, any solution?

0
Comment actions Permalink

Hi everyone,

Sorry for being silent. If you see the OFF or pause sign in the top-right corner then it means that all highlightings have been turned off for your files.
There can be several reasons for that:

  1. Those files/folders are excluded from code analysis via "Elements to skip" on "File | Settings | Editor | Inspection Settings"
  2. The code analysis is disabled completely in "File | Settings | Editor | Inspection Settings"
  3. The project is opened as a folder, not as a solution. Please make sure you use "File -> Open -> Solution or Project"
  4. The file size is too big. To enable code analysis for the particular file, right-click on OFF in the top-right corner of the editor, select "Customize highlighting level", and pull the scroll indicator to "Inspections"

Hope it helps!

0
Comment actions Permalink

I'm getting a similar problem on Rider 2019.2.3 but inspections seem to have run but then something happened. I upgrade to this version from some 2018 version today (cleaned settings and everything else when uninstall the old one).

 

 

Solution wide analysis seems to be ON and finished running. When I open the file it briefly does the correct highlighting but in a matter of milliseconds lose it.

 

any tips to debug it? already tried invalidate cache/restart.

1
Comment actions Permalink

Same problem -- no C# highlight inside code block in Razor Pages with custom color schema.

0
Comment actions Permalink

Hi Vlad,

Can you reproduce it on a Razor page in a new project? Are all the .cshtml files affected in your current project? What Rider version are you using at the moment?

0

Please sign in to leave a comment.