I recently upgraded my website from ASP.NET MVC3 (Razor) to MVC4 (Razor2), and in doing so found what seemed like a breaking change in the Razor view engine.
The sce
This is indeed a bug we decided not to fix, note that the syntax is incorrect as there is no transition between C# and markup in this case.
I understand that resharper shows a warning here but I believe the warning is wrong.
Here is the bug for future reference https://aspnetwebstack.codeplex.com/workitem/458
Seems like a bug. It works with String:
@foreach (var x in Model)
{
@String.Format("Foo bar: {0}", x)
}