Breaking changes in Razor version 3.0 vs. 2.0

Jan 21, 2014 at 8:19 AM
Edited Jan 21, 2014 at 8:23 AM
Hello devs,

we've decided to upgrade Razor from version 2.0 to 3.0 in our MVC 4 project. The reason is that Razorengine (which uses Razor 3.0) is used be the other project which needs to be connected to the MVC one. As app domain can't normally contain 2 different versions of assembly, it was decided to upgrade to Razor 3.

So could you please tell - are there any breaking changes in Razor 3.0 compared to 2.0 version, and can ASP.NET MVC 4 work normally with Razor 3.0?
Jan 21, 2014 at 5:28 PM

MVC3 is compatible only with Razor v1
MVC4 is compatible only with Razor v2
MVC5 is compatible only with Razor v3

They cannot be mixed, unfortunately.

From Razor 2 to Razor 3 there were no deliberate breaking changes, but I think there were maybe a couple of bug fixes that caused a slight change in behavior in obscure cases (such as redundant usage of "@" in C# code). But in general Razor has been highly compatible across versions.