500 Wewnętrzny błąd serwera żądający plików zasobów (css, js, images) w witrynie .Net MVC 3

AKTUALIZACJA: Rzeczy, które próbowałem - zobacz rozwiązanie poniżej

Zainstalowałem świeżą witrynę MVC3 i poprawnie obsługiwał zasoby. To wyeliminowało ustawienia machine.config.Następnie, w sekcji po sekcji w web.config, sprawdzę, czy jakieś szczególne zmiany w web.config spowodowały problem. Gdy konfiguracje były identyczne, nowa witryna nadal działała, a stara strona nadal była uszkodzona.Odinstalowałem usługi IIS, ponownie zainstalowałem usługi IIS, a następnie ponownie zainstalowałem aplikacje, próbując usunąć wszystkie ustawienia, które pozostały. Nadal jestem zakorkowany.Następnie użyłem publikowania (zamiast msi deploy) do nowego katalogu. Użyłem opcji iis do „Utwórz aplikację” w nowym katalogu o tym samym kodzie, który jest uszkodzony. Wszystko działało idealnie.Przyjąłem uprawnienia do plików, więc usunąłem obrażający katalog i przemianowałem nową działającą wersję na starą nazwę katalogu. Witryna nadal była zakorkowana. To sprawiło, że założyłem, że winę ponosi niektóre ustawienia iis, których nie ma w pliku machine.config lub web.config.Użyłem eksploratora Metabase IIS 6 (tak, użyłem go na stronie IIS 8) i zobaczyłem kilka wpisów, które nie znajdowały się w witrynie roboczej. Po usunięciu pojedynczo znalazłem, że to wpis „scriptMaps” został dodany podczas instalacji MSI, co spowodowało problem. Zostało to dodane w celu automatycznego dodawania mapowań wieloznacznych podczas instalacji. Działa na IIS6, ale najwyraźniej nie na IIS8.

Mamy formularze internetowe i aplikację MVC3, które wyglądają jak jedna aplikacja. Jest to wdrażane w wielu środowiskach (2003, 2008, Win 7) i działa poprawnie. Właśnie ustawiłem te aplikacje na nowej maszynie z systemem Windows Server 2012 i wszystko działa z wyjątkiem pobierania plików zasobów dla witryny MVC. Przeglądarka otrzyma

500 Internal Server Error
Server Application Unavailable

The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur. 

Zasoby są wymienione w _layout.cshtml

<head>
    <meta http-equiv='X-UA-Compatible' content='IE=EmulateIE8' />
    <title>@this.Title</title>
    <script type="text/javascript" src="@Url.Content("~/Scripts/2012.2.607/jquery-1.7.1.min.js")"></script>    
    <script type="text/javascript" src="/Sentri7/scripts/jquery-p1s.banner.js"></script>
    <script type="text/javascript" src="/Sentri7/scripts/jquery-p1s.patientsearch.js"></script>
    <link type="text/css" rel="stylesheet" href="/sentri7/content/jquery-p1s.patientsearch.css"></link>
    <link type="text/css" rel="stylesheet" href="/sentri7/content/jquery-p1s.banner.css" />
    <link type="text/css" rel="stylesheet" href="/quantifi/resources/application/css/jqueryui/jquery-ui-1.7.2.custom.css" />
    <link type="text/css" rel="stylesheet" href="/quantifi/resources/application/css/styles.css" />
    @(RenderSection("PageHead", required: false))
</head>

jak również za pomocą programu do zarządzania skryptami telerik:

@{
    Title = "Reportable Conditions";
    SelectedSubTab = SubTabIndex.Reportables;
    Html.Telerik().ScriptRegistrar().DefaultGroup(dg => dg
        .Add("~/Scripts/ReportableConditions/List.js")
        .Add("~/Scripts/ClientObjects/GridSettings.js"))
        .OnDocumentReady("bootStrapUI()");
}

Jeśli spróbuję przejść bezpośrednio do pliku javascript, pojawia się ten sam błąd:

http://[server]/S7D/Scripts/2012.2.607/jquery-1.7.1.min.js

Jakieś dziwne rzeczy:

Jeśli I IISReset i uderzy w plik js, będzie działać tylko pierwsze żądanie.

Żądania js, css lub obrazu z innej witryny (webforms) (tej samej puli aplikacji) na serwerze działają prawidłowo.

W dzienniku zdarzeń nie ma nic związanego z tym błędem 500.

Próbowałem dodać uprawnienia pełne uprawnień użytkownikowi, na którym działa pula aplikacji. Dodałem także uprawnienia do plików do [komputera] IUSR.

Oto mój web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <configSections>
    <sectionGroup name="telerik">
      <section name="webAssets" type="Telerik.Web.Mvc.Configuration.WebAssetConfigurationSection, Telerik.Web.Mvc" requirePermission="false" />
    </sectionGroup>
    <sectionGroup name="spring">
      <section name="typeAliases" type="Spring.Context.Support.TypeAliasesSectionHandler, Spring.Core" />
      <section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web" />
      <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
    </sectionGroup>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <spring>
    <context>
      <!-- Load web.config definition ** This resource reference is essential to define objects in the web.configs -->
      <resource uri="config://spring/objects" />
      <resource uri="assembly://CAS2/CAS2.CASLibDAO/_SpringObjects.xml" />
      <resource uri="file://~/App_Data/MvcApplicationContext.xml" />
      <resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext/ApplicationContext-Common.xml" />
      <resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext/ApplicationContext-DAO.xml" />
      <resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext/ApplicationContext.xml" />
      <resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext/Services.xml" />
      <resource uri="assembly://P1S.S7D.Common/P1S.S7D.Common.ApplicationContext/ApplicationContext-AuthModule.xml" />
      <resource uri="assembly://P1S.S7D.Common/P1S.S7D.Common.ApplicationContext/ApplicationContext-Web-Common.xml" />
      <resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext.WCF/ApplicationContext.xml" />
      <resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext/ApplicationContext-Circular-Reference-IPReporting.xml" />
    </context>
    <objects xmlns="http://www.springframework.net">
      <!--cached objects-->
    </objects>
  </spring>
  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="P1S.S7D.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="P1S.S7D.Web.Mvc" />
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
        <add namespace="Telerik.Web.Mvc.UI" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>



  <appSettings>
    <add key="Spring.Data.NHibernate.Support.OpenSessionInViewModule.SessionFactoryObjectName" value="NHibernateSessionFactory" />
    <add key="Spring.Data.NHibernate.Support.OpenSessionInViewModule.EntityInterceptorObjectName" value="MultiTenantInterceptor" />
    <add key="webpages:Version" value="1.0.0.0" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  <system.web>
    <sessionState allowCustomSqlDatabase="true" mode="SQLServer" sqlConnectionString="Server=dev-ct-nhsn.dev.rph.int;Database=aspstate;User ID=UID;Password=*****; Application Name=S7DSharedSession" />
     <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/LogOn" timeout="2880" />
    </authentication>
    <membership>
      <providers>
        <clear />
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
      </providers>
    </membership>
    <profile>
      <providers>
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
      </providers>
    </profile>
    <roleManager enabled="false">
      <providers>
        <clear />

        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>
    <pages pageBaseType="P1S.S7D.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="P1S.S7D.Web.Mvc" />
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
        <add namespace="Telerik.Web.Mvc.UI" />
      </namespaces>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </controls>
    </pages>
    <httpHandlers>
      <add verb="GET,HEAD" path="asset.axd" validate="false" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
    </httpHandlers>
    <httpModules>
      <add name="AuthenticationModule" type="Web.Handlers.AuthenticationModule,P1S.S7D.Web.Mvc" />
      <add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web" />
      <add name="OpenSessionInView" type="Spring.Data.NHibernate.Support.OpenSessionInViewModule, Spring.Data.NHibernate31" />

    </httpModules>
        <customErrors mode="Off" />

  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web" />
      <add name="AuthenticationModule" type="Web.Handlers.AuthenticationModule,P1S.S7D.Web.Mvc" />
      <add name="OpenSessionInView" type="Spring.Data.NHibernate.Support.OpenSessionInViewModule, Spring.Data.NHibernate31" />

    </modules>
    <!--    -->
    <handlers>
      <remove name="asset" />
      <add name="asset" preCondition="integratedMode" verb="GET,HEAD" path="asset.axd" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
    </handlers>

  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="NHibernate" culture="neutral" publicKeyToken="aa95f207798dfdb4" />
        <bindingRedirect oldVersion="3.1.0.4000" newVersion="3.3.1.4000" />
      </dependentAssembly>
    </assemblyBinding>    
  </runtime>
  <telerik>
    <webAssets useTelerikContentDeliveryNetwork="false" />
  </telerik>
</configuration>

Wszystkie zasoby, niezależnie od tego, czy używasz Telerika, czy dodając je za pomocą znacznika skryptu, dają 500 błędów. Kontroler i widok są wyświetlane poprawnie (bez stylów lub javascript)

EDYTOWAĆ:

Zarejestruj trasy:

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        RouteTable.Routes.RouteExistingFiles = false;
        routes.MapRoute(
           "Default", // Route name
           "{controller}/{action}/{id}", // URL with parameters
           new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
       );
    }

questionAnswers(3)

yourAnswerToTheQuestion