.cshtml files displaying as plain html

I had a problem setting up a website hosted on Windows Server 2012. A website is just the default website that you get when you create a new site called ASP.NET Website (Razor v2). Then I just published it using the Publish Website option in VS2012. I also added the .cshtml extension in MIME types. The server runs IIS v8 and .NET v4. The problem is that when I visit the website, it looks like this:

http://i806.photobucket.com/albums/yy341/SamuelCB/Razor%20Error/Untitled.png

Is there something I am missing?

+4
source share
1 answer

:

  • MIME- , IIS ASP.Net

    • , , MIME , / , IIS/ASP.Net " ", MIME-.

    • ".cshtml" , IIS () , ASP.Net ( "" ) (, ). "unparsed" () ... ... IIS ( ASP.net).

  • , - - , . ASP.Net. , (re) ASP.Net

  • , , .Net Framework 4.x, , ASP.Net. , . "" , " " (, ), , . ASP.Net, ASP.Net .

    • Nuget . , " bin" ( / /bin ):
      • Microsoft ASP.NET Razor
      • - Microsoft ASP.NET
      • Microsoft.Web.Infrastructure

: ServerFault, , SO... ... -... ....

Hth...

+3

All Articles