System.Web.Razor and System.Web.WebPages.Razor will make ServiceStack.Razor do not work

Hi
I use service stack razor to implement my website now. But there is a issue to add a new cshtml.

  1. when i want to add a new cshtml, i right click my project, and select Add->razor view

  2. after add a new cshtml file, i find VS add these packages in my project.

     <package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
      <package id="Microsoft.AspNet.Mvc.zh-Hans" version="5.2.3" targetFramework="net45" />
      <package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" />
      <package id="Microsoft.AspNet.Razor.zh-Hans" version="3.2.3" targetFramework="net45" />
      <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
      <package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.2.3" targetFramework="net45" />
      <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
    
  3. and then when i run my project, my default.cshtml is just downloaded by browser.

  4. remove System.Web.Razor and System.Web.WebPages.Razor, web site work again.

So i want to know how to add a new cshtml file, and why System.Web.Razor break ServiceStack.Razor.

VS.NET Adds MVC Razor dependencies which is incompatible with ServiceStack.Razor, i.e. you can’t run both at same time. Don’t use VS.NET Helpers, just copy and paste Razor Views, i.e. treat them like text files.

@benhaben another option if you have ServiceStackVS extension installed is to use the “Web Page (Razor v3)” item template with the ServiceStack logo.

This is the same as adding a text file like @mythz is suggesting but might be a bit more intuitive to find.