Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6597917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:16:16+00:00 2026-05-25T18:16:16+00:00

I have standard ASP.NET 4 application. Inside this application there are also few razor

  • 0

I have standard ASP.NET 4 application. Inside this application there are also few razor (e.g. test.cshtml) files. ASP.NET application works however if I point browser to /test file (without extension). IIS (static file handler) returns 404.

The same application and even the standalone .cshtml files are working on local machine (with IIS7.5/Win7) and a server with (IIS7.5/Win2008R2), however it does not work the server with IIS7.0/Win2008.

MVC3 is installed on both machines, app pools on both machines are .NET 4.0 integrated.

How the .cshtml handlers works? When the IIS decides to use static file handler and when the .cshtml handler? What else should I check?

EDIT:

Clarification – I am not actually using whole MVC framework, it is just like plain-old .ASPX or PHP file. No controllers, no routes, no ‘views’. I am using it for a simple script in addition to old ASP.NET application.

I think it is not a programming issue, since it works on local computer, but rather a configuration issue – the IIS on the Win2008 server might not be configured properly.

EDIT2:

(Machines with IIS7.5 works, only machine with IIS7.0 does not work. But I am not sure whether it is a problem of IIS version.)

EDIT3:

On my local computer where it works, I have not set any routing. TheCodeKing and Keith suggested that I need to have a routing somewhere. Maybe yes, but it is not in my application. It might be set by default somewhere in IIS configuration.

Do you have any hints where this ‘implicit’ routing could be found?

EDIT4:

Note: On all computers there is HttpForbiddenHandler for *.cshtml, since you cannot download the cshtml file. And there is also the TransferRequestHandler for *.. (Both are enabled.)

EDIT5:

I have found that on the servers, where it is working, I need to have any .cshtml file in the web root. If I remove the .cshtml from the web root and try to invoke any from a subdirectory it will not work.

EDIT6:

I tried that on another two machines: one with IIS 7.5 and another with IIS 7.0. On IIS 7.5 it works (plain install no configuration), but on IIS 7.0 it does not work.

How to make it work on IIS 7.0?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:16:17+00:00Added an answer on May 25, 2026 at 6:16 pm

    Yay! After several days of struggling I’ve found it! :))

    One way to make it work on IIS 7.0 is to enable runAllManagedModulesForAllRequests:

    <modules runAllManagedModulesForAllRequests="true" />
    

    (Although, on IIS 7.5 it works even with the default value runAllManagedModulesForAllRequests="false".)

    Don’t ask me why:) Maybe someone can explain that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

if i have a standard ASP.NET application, is there any difference between making an
I have an ASP.NET application that authenticates users using Ldap against active directory. This
I have a standard ASP.NET MVC (RC Refresh) web project, with the standard ASP.NET
Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators? For
I have a bunch of ASP.NET web pages (that have a standard layout) that
In an ASP.NET 3.5 site we have a relatively standard payment checkout progess that
Does ASP.NET MVC provide a standard validator functionality or do you have to create
When setting up a new ASP.NET MVC Web Application, the default connection string inside
I have an ASP.Net MVC web application using forms authentication. I am using OpenID
I am an asp.net web application developer and I always have used Enterprise Library

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.