When I run my application locally ( VS2013 installed ) everything works fine, but when I deploy the files to another server with only basic IIS installed I get missing CSHTML missing.
Error details:
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
Module
StaticFileModule
Notification
ExecuteRequestHandler
Handler
StaticFile
Error Code
0x80070032
Requested URL
http://localhost:80/myapp/Default.cshtml
Physical Path
C:\inetpub\wwwroot\myapp\Default.cshtml
Logon Method
Anonymous
Logon User
Anonymous
...if I add the MIME type it literally just renders some text of my razor view.
I feel like I'm missing some root dependency in my nuget packages that are deployed that is installed by vs out of the box.
My project references look like: http://www.screencast.com/t/BKoB4MSWX and http://www.screencast.com/t/NOOMxD3sYn ... anyone know what im missing?
Updates: No MVC components are installed, I'm not using any MVC just this one page is cshtml. I also don't have any razor dependencies installed at the moment. My app is targeted at .net 4.5.1 . I'm using IIS 7.5. App pool is integrated 4.0 on Windows Server 2008 R2
Your problem is probably that you have Razor dependencies in your GAC, but when you deploy they are not there on the remote server.
Install the Web Pages package: Install-Package Microsoft.AspNet.WebPages
You might be missing more things, but that's the minimal starting point
IIS returns 404 for ASP.NET MVC3 file (.cshtml)
Enable runAllManagedModulesForAllRequests
:
<modules runAllManagedModulesForAllRequests="true" />
Is this what you're looking for?
Check if ‘CSHTML’ is mapped in IIS Manager. From IIS Manager, select the site you want to add the MIME to from the Connections left pane, In the Home pane, double-click MIME Types. In the MIME Types pane, click Add... in the Actions pane. mimeMap fileExtension=".cshtml" mimeType="application/x-cshtml" Alternatively, you could use the conf file applicationHost.conf C:\Windows\System32\inetsrv\Config: • And running from command: aspnet_regiis –iru • C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -iru
User contributions licensed under CC BY-SA 3.0