Bug 20984 - Razor syntax highlighting doesn't work sometimes
Summary: Razor syntax highlighting doesn't work sometimes
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: ASP.Net ()
Version: 5.0.1
Hardware: PC Windows
: Normal normal
Target Milestone: master
Assignee: Bugzilla
Depends on:
Reported: 2014-06-30 17:46 UTC by pinggi
Modified: 2016-07-01 00:35 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Missing syntax highlighting in Razor syntax (20.69 KB, image/png)
2014-06-30 17:46 UTC, pinggi

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 20984 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description pinggi 2014-06-30 17:46:54 UTC
Created attachment 7236 [details]
Missing syntax highlighting in Razor syntax

Look at the attachment please.
Comment 1 Udham Singh 2014-07-01 05:42:43 UTC
I have checked this issue and able to reproduce this. To reproduce this issue I have have followed the steps mentioned below :

1. Create a new "ASP.NET MVC 3 Project(Razor)" application.
2. Open _Layout.cshtml and implement the below code


<a href="@(ViewBag.Page.Parent.Url)">@ViewBag.Page.Parent.LinkTitle</a>

@foreach(var page in ViewBag.Page.PageNodes){
<li><a href="@(page.Url)">@page.LinkTitle</a></li>

3. Save _Layout.cshtml file and close it.
4. Open _Layout.cshtml file and observe the variables color in line no. 4 and 9

I have also noticed that when we open file _Layout.cshtml and press enter after <a href="@(ViewBag.Page.Parent.Url)">@ViewBag.Page.Parent.LinkTitle</a> line the variables color got changed.

Screencast : http://www.screencast.com/t/7bY0zpGih

Environment Info : 

Windows 8.1
XS 5.0.1 (build 3)