Getting 404 error on MVC web-site

前端 未结 14 1085
暗喜
暗喜 2020-12-06 05:49

I have an IIS7.5 web-site, on Windows Server 2008, with an ASP.NET MVC2 web-site deployed to it. The website was built in Visual Studio 2008, targeting .NET 3.5, and IIS 5.1

相关标签:
14条回答
  • 2020-12-06 06:28

    My Hosting company fixed this for me by doing this (I removed the original password value of course).

      <system.webServer>
        <security>
          <authentication>
            <anonymousAuthentication password="<password>" />
          </authentication>
        </security>
      </system.webServer>
    
    0 讨论(0)
  • 2020-12-06 06:36

    Do you have a problem with just 1 page or the whole site is not working?

    A) 1 page

    • You can use RouteDebugger to verify if the route is matched correctly

    B) Whole site

    • I assume you're using Windows Server - check if ASP.NET is enabled in IIS - it's disabled by default, I believe.

    • You can use MvcDiagnostics page to check if all dlls are deployed properly.

    • Are you running in IIS7 integrated mode? Classic mode of IIS7 does not automatically map extensionless URLs to ASP.NET (much like IIS6)

    • Make sure your Web.config tag is configured correctly.

    0 讨论(0)
  • 2020-12-06 06:37

    Glad that fixed your problem. Others researching this issue should take note of the extensionless URL hotfix: http://support.microsoft.com/kb/980368

    0 讨论(0)
  • 2020-12-06 06:37

    You'll also get this if your bindings aren't correct. If you don't have www or a subdomain it'll return a 404.

    0 讨论(0)
  • 2020-12-06 06:38

    For me it was all about installing .NET Framework 4.6.1 on the server (my app was targeting that version)

    0 讨论(0)
  • 2020-12-06 06:41

    Apparently this can have many different causes.

    For us, the problem was that the DNS entry was configured for two IP addresses, but the IIS configuration would only listen to one of them. So we got unpredictable results, sometimes it would work, sometimes a few files (css, etc) would not load, and sometimes the whole page would not load.

    0 讨论(0)
提交回复
热议问题