locked
HTTP Error 500.19 - Internal Server Error after installation on IIS RRS feed

  • Question

  • User1310055179 posted

    Hi,

    I am trying to install an asp.net 4.5 web form app on IIS 8.5, on windows server 2012 r2 and I get the following error message:

    <div id="content"> <div class="content-container">

    HTTP Error 500.19 - Internal Server Error

    The requested page cannot be accessed because the related configuration data for the page is invalid.

    <div id="content"> <div class="content-container">

    <fieldset>

    Detailed Error Information:

    <div id="details-left">
    Module    IIS Web Core
    Notification    BeginRequest
    Handler    Not yet determined
    Error Code    0x8007007b
    Config Error    Cannot read configuration file
    </div></fieldset>

    </div> </div> </div> </div>

    The application works just fine after installing it on my local IIS.

    I am trying to test it using the defaultapppool which is set to v4.0 version. The defaultapppool works great with different applications. I gave the app folder modify permissions for the IIS_IUSRS and USERS. 

    These are my configuration files located on the root folder:

    Web.Config:

    <?xml version="1.0" encoding="utf-8"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    <configuration>
      <!--<configSections>
        --><!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --><!--
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      </configSections>
      <connectionStrings/>-->
      
      <system.web>
        <!--remove ASP.NET version from the header- for security- 280818-->
        <httpRuntime enableVersionHeader="false"/>
        
        <compilation debug="true" targetFramework="4.5" />
        
        <pages>
          <namespaces>
            <add namespace="System.Web.Optimization" />
          </namespaces>
          <controls>
            <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
          </controls>
        </pages>
     
        <authentication mode="Forms">
          <forms loginUrl="login.aspx" slidingExpiration="true" name="MyCustomAuthentication" timeout="60"/>
        </authentication>
        <!--authentication timeout needs to be double the size of the session timeout (if slidingExpiration is set to TRUE)-->
        
        <authorization>
          <deny users="?"/>
        </authorization>
        <sessionState mode="InProc" timeout="30"/>
        <customErrors mode="On" defaultRedirect="ErrorPage.aspx?handler=customErrors%20section%20-%20Web.config">
          <error statusCode="404" redirect="ErrorPage.aspx?msg=404&amp;handler=customErrors%20section%20-%20Web.config"/>
        </customErrors>
        <globalization requestEncoding="windows-1255" responseEncoding="windows-1255" fileEncoding="windows-1255" culture="he-IL" uiCulture="he-IL"/>
        
        <profile defaultProvider="DefaultProfileProvider">
          <providers>
            <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
          </providers>
        </profile>
        
        <!--
                If you are deploying to a cloud environment that has multiple web server instances,
                you should change session state mode from "InProc" to "Custom". In addition,
                change the connection string named "DefaultConnection" to connect to an instance
                of SQL Server (including SQL Azure and SQL  Compact) instead of to SQL Server Express.
          -->
        
      </system.web>
     
      <system.webServer>
        
        <!--remove X-Powered-By from the header- for security- 280818-->
        <httpProtocol>
          <customHeaders>
            <remove name="X-Powered-By"/>
          </customHeaders>
        </httpProtocol>
        <validation validateIntegratedModeConfiguration="false"/>
        
      </system.webServer>
     
      <!--allow all users to see the Images folder (for login page)-->
      <location path="Images">
        <system.web>
          <authorization>
            <allow users="*"/>
          </authorization>
        </system.web>
      </location>
      <!--allow all users to see the login page-->
      <location path="login.aspx">
        <system.web>
          <authorization>
            <allow users="*"/>
          </authorization>
        </system.web>
      </location>
      
      
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
            <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
            <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <!--<entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
      </entityFramework>-->
    </configuration>

    packages.config:

    <?xml version="1.0" encoding="utf-8"?>
    <packages>
      <package id="AspNet.ScriptManager.jQuery" version="1.8.2" targetFramework="net45" />
      <package id="AspNet.ScriptManager.jQuery.UI.Combined" version="1.8.24" targetFramework="net45" />
      <package id="DotNetOpenAuth.AspNet" version="4.1.4.12333" targetFramework="net45" />
      <package id="DotNetOpenAuth.Core" version="4.1.4.12333" targetFramework="net45" />
      <package id="DotNetOpenAuth.OAuth.Consumer" version="4.1.4.12333" targetFramework="net45" />
      <package id="DotNetOpenAuth.OAuth.Core" version="4.1.4.12333" targetFramework="net45" />
      <package id="DotNetOpenAuth.OpenId.Core" version="4.1.4.12333" targetFramework="net45" />
      <package id="DotNetOpenAuth.OpenId.RelyingParty" version="4.1.4.12333" targetFramework="net45" />
      <package id="EntityFramework" version="5.0.0" targetFramework="net45" />
      <package id="jQuery" version="1.8.2" targetFramework="net45" />
      <package id="jQuery.UI.Combined" version="1.8.24" targetFramework="net45" />
      <package id="Microsoft.AspNet.FriendlyUrls" version="1.0.0" targetFramework="net45" />
      <package id="Microsoft.AspNet.FriendlyUrls.Core" version="1.0.0" targetFramework="net45" />
      <package id="Microsoft.AspNet.Membership.OpenAuth" version="1.0.1" targetFramework="net45" />
      <package id="Microsoft.AspNet.Providers.Core" version="1.2" targetFramework="net45" />
      <package id="Microsoft.AspNet.Providers.LocalDB" version="1.1" targetFramework="net45" />
      <package id="Microsoft.AspNet.ScriptManager.MSAjax" version="4.5.6" targetFramework="net45" />
      <package id="Microsoft.AspNet.ScriptManager.WebForms" version="4.5.6" targetFramework="net45" />
      <package id="Microsoft.AspNet.Web.Optimization" version="1.0.0" targetFramework="net45" />
      <package id="Microsoft.AspNet.Web.Optimization.WebForms" version="1.0.0" targetFramework="net45" />
      <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
      <package id="Modernizr" version="2.6.2" targetFramework="net45" />
      <package id="WebGrease" version="1.1.0" targetFramework="net45" />
    </packages>

    Bundle.config:

    <?xml version="1.0" encoding="utf-8" ?>
    <bundles version="1.0">
      <styleBundle path="~/Content/css">
        <include path="~/Content/Site.css" />
      </styleBundle>
      <styleBundle path="~/Content/themes/base/css">
        <include path="~/Content/themes/base/jquery.ui.core.css" />
        <include path="~/Content/themes/base/jquery.ui.resizable.css" />
        <include path="~/Content/themes/base/jquery.ui.selectable.css" />
        <include path="~/Content/themes/base/jquery.ui.accordion.css" />
        <include path="~/Content/themes/base/jquery.ui.autocomplete.css" />
        <include path="~/Content/themes/base/jquery.ui.button.css" />
        <include path="~/Content/themes/base/jquery.ui.dialog.css" />
        <include path="~/Content/themes/base/jquery.ui.slider.css" />
        <include path="~/Content/themes/base/jquery.ui.tabs.css" />
        <include path="~/Content/themes/base/jquery.ui.datepicker.css" />
        <include path="~/Content/themes/base/jquery.ui.progressbar.css" />
        <include path="~/Content/themes/base/jquery.ui.theme.css" />
      </styleBundle>
    </bundles>
    

    I would really appreciate your help.

    Thanks

    Monday, October 26, 2020 12:49 PM

Answers

  • User753101303 posted

    You are using IIS Manager or the command line or a deployment tool?  My first move would be to select the site and use "Basic settings..." in the right pane to see if the "Physical path" is C:\inetpub\wwwroot\Qset rather than C:\inetpub\wwwroot\\Qset

    Maybe a wrong value was accidentaly entered and that some Windows functions are cleaning up automatically a wrong path while others won't ???

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 27, 2020 3:20 PM

All replies

  • User-939850651 posted

    Hi qsoft_developer,

    The application works just fine after installing it on my local IIS.

    I am trying to test it using the defaultapppool which is set to v4.0 version. The defaultapppool works great with different applications. I gave the app folder modify permissions for the IIS_IUSRS and USERS.

    According to your description, I did some searches for the issue, and I found that the issue is usually related to the configuration of the path.

    I think whether there are corresponding problems in the configuration file, please check it.

    You could also refer to the following similar cases:

    https://shades-of-orange.com/post/HTTP-Error-50019-Internal-Server-Error-0x8007007b-Cannot-read-configuration-file

    https://forums.iis.net/t/1155302.aspx

    Hope this can help you.

    Best regards,

    Xudong Peng

    Tuesday, October 27, 2020 7:57 AM
  • User753101303 posted

    Hi,

    Check "Authentication",  "Anonymous authentication", "Edit...". It is likely on the "IUSR" specific user. If confirmed try to use "Application pool identity" instead. See also https://docs.microsoft.com/en-us/iis/get-started/planning-for-security/understanding-built-in-user-and-group-accounts-in-iis#understanding-the-new-iusr-account and it would be the same than using userName="". It should solve the issue for now.

    If adding later more applicaations, it is AFAIK generally suggested to use a dedicated pool and identity - possibly a domain account- to which you'll grant access so that each app is better isolated from others.

    Tuesday, October 27, 2020 8:31 AM
  • User1310055179 posted

    When I try clicking on the Authentication in the IIS Manager I get the following error message:

    ---------------------------
    Authentication
    ---------------------------
    There was an error while performing this operation.

    Details: 

    Filename: \\?\C:\inetpub\wwwroot\\Qset\web.config
    Error: Cannot read configuration file

    ---------------------------
    OK   
    ---------------------------

    I actually get the same error when I try to click the Default page settings inside the IIS Manager.

    Tuesday, October 27, 2020 11:45 AM
  • User1310055179 posted

    I also tried using a new application pool set to Integrated.

    I tried switching between version v.4 and "No Managed Code"  .NET CLR Version options. None of these worked.

    Tuesday, October 27, 2020 11:47 AM
  • User1310055179 posted

    According to your description, I did some searches for the issue, and I found that the issue is usually related to the configuration of the path.

    Where can I see the path configuration?

    Tuesday, October 27, 2020 11:48 AM
  • User753101303 posted

    Ah it's weird that you have \C:\inetpub\wwwroot\\Qset\web.config (ie a double slash) and the 0x8007007b error seems to confirm an invalid path issue: https://shades-of-orange.com/post/HTTP-Error-50019-Internal-Server-Error-0x8007007b-Cannot-read-configuration-file

    Now the problem is that I don't really know how the web.config file path could be messed up this way unless maybe you hand edited IIS config files ?

    Edit: or could it be that the path for the default web site is c:\inetpub\wwwroot\ (with a trailing slash) rather than c:\inetpub\wwwroot ?

    Tuesday, October 27, 2020 1:58 PM
  • User1310055179 posted

    I have just noticed the double slash in the path! How can I change it? where is it defined?

    As far as I know, I didn't change anything in the IIS settings...

    It is not the first time that I'm installing an IIS web forms application and I've already installed other apps on the same server (which seem to work just fine).

    Tuesday, October 27, 2020 2:25 PM
  • User753101303 posted

    You are using IIS Manager or the command line or a deployment tool?  My first move would be to select the site and use "Basic settings..." in the right pane to see if the "Physical path" is C:\inetpub\wwwroot\Qset rather than C:\inetpub\wwwroot\\Qset

    Maybe a wrong value was accidentaly entered and that some Windows functions are cleaning up automatically a wrong path while others won't ???

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 27, 2020 3:20 PM
  • User1310055179 posted

    You were right! I fixed it!

    I'm using a web deployment project to install it on the IIS server.

    I have no idea what changed it only for this specific application...

    Thank you very much for your help!

    Tuesday, October 27, 2020 3:43 PM