Hello.

I'm trying to publish a site on a server (Windows Server 2008 R2) using IIS (version 7.5). The site itself wrote on ASP.NET with the version of .NET 4.5, and included support for Windows authentication in it.

When you start the site on a local machine from Visual Studio, everything works fine, it goes to all pages and everything works. However, when I publish a site in IIS, I only go to the standard Default.aspx page and when I try to go to other pages (even to "Contacts"), I get an error, and it doesn't matter if I go to the server or launch a browser directly on the server:

HTTP Error 404.0 - Not Found The resource you were looking for was deleted, its name was changed, or it is temporarily unavailable.

The requested URL is http: // localhost: 80 / sitename / Contact

Physical path C: \ IIS_Apps \ sitenameASP \ wwwroot \ sitename \ Contact

Login Method Negotiate
User who logged in OFFICE \ igutnikov

Windows Authentication in IIS is enabled and works — a request is being entered when entering the site, anonymous authentication is disabled. The folder in which the site is stored and its pages have all the rights.

What could be the problem? How to solve it?

================================================= ===========

UPD: Found a solution - you need to add to the global Web.config:

<modules runAllManagedModulesForAllRequests="true"> <remove name="BundleModule" /> <add name="BundleModule" type="System.Web.Optimization.BundleModule" /> </modules> 
  • And the application in the sitename folder is created? right click on the folder in IIS Manager / Convert to application. - PashaPash ♦
  • @PashaPash added through "Add application ...", so in theory it was created. - IlyaGutnikov
  • The solution to the problem was found here: blog.cdeutsch.com/2012/11/… ... - IlyaGutnikov
  • This is a wildly crooked solution - it starts to carry out all requests through the managed code in general, including requests to static files. There are a couple of standard problems with the extensionless url, now I’ll try to write the answer with a list of fixes - PashaPash ♦

1 answer 1

There are several standard reasons why extensionless urls may not work without extensions.

  1. You have a crooked .net. Solved by a challenge

     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -r 
  2. There are not enough standard updates (relevant for Windows Server until 2012). It is solved by installing https://support.microsoft.com/en-us/kb/980368 .

  3. IIS was delivered to the system after .NET. In principle, it is solved (1), but you can try the solution with the inclusion of one of the features in Add Remove Windows Features:

    • Internet Information Services -> World Wide Web Services -> Common HTTP Features -> HTTP Error Redirection
    • Internet Information Services -> World Wide Web Services -> Performance Features -> Static Content Compression

    https://support.microsoft.com/en-us/kb/2023146


The crutch with runAllManagedModulesForAllRequests="true" is common, but should not be used on real servers. It leads precisely to what is written in the option name - in general, all requests begin to pass through managed modules. Ie, for example, checking cookies with the Forms Auth ticket will occur on all requests in general, including images, css, scripts and favicon, which leads to potential performance problems.