The File Extensions Database


.CSHTML File Extension

  • Developer by: Microsoft
  • Category: Web Files
  • Format: Text

What is an .CSHTML file?

.CSHTML is ASP.NET Razor Web Page

C# ("C sharp") HTML webpage file used by Razor, an ASP.NET view engine used for generating Web pages for a user's Web browser; similar to a standard ASP.NET webpage (.ASP or .ASPX file), but uses a slightly different syntax; runs on a Web server, which generates the HTML for the client Web browser; can be programmed with syntax highlighting and Intellisense code suggestions using Microsoft Visual Studio.

CSHTML files are similar to .VBHTML (Visual Basic HTML) files, but they use syntax that is closer to the C# language rather than the Visual Basic language.

NOTE: Razor offers new templating syntax operations in addition to those supported by the standard ASP.NET MVC default view engine.

Programs that open ASP.NET Razor Web Page
Windows
Microsoft Visual Studio 2017

How to solve problems with CSHTML files

  • Associate the CSHTML file extension with the correct application. On :
    Windows: Right click on any CSHTML file and then click "Open with" > "Choose another app". Now select another program and check the box "Always use this app to open *.CSHTML files". Mac: Right click (or Ctrl-click) the CSHTML file, then click "Open with" > "Other...". Then choose another program and check the "Always Open With" box. Linux: Right click on the file, and select "Open with" and choose another program. iPhone: Tap the file. If you do not see an app to open the file, then tap Share "Share" and choose an app. Alternatively, save the file. Then open the Files app Files app. There long-press on the file, then release your finger. You will see a black menu bar. Then tap "Share" and select an app. Android: Tap the Settings icon on your smartphone, then tap on the Apps section. There tap the Options icon in the top right-hand corner of the screen to change the default apps.
  • Update your software that should actually open .CSHTML is ASP.NET Razor Web Page. Because only the current version supports the latest CSHTML file format. Search, therefore, e.g. on the Microsoft manufacturer website after an available .CSHTML is ASP.NET Razor Web Page update.
  • To make sure that your CSHTML file is not corrupted or virus-infected, get the file again and scan it with antivirus software.