Startar site on IIS is returning error 500

Asked

Viewed 13,542 times

4

inserir a descrição da imagem aquiTrying to learn how to set up a site on IIS, by typing the site URL, this gives the following error:

Server Error

500 - Internal server error. There is a problem with the resource that you are looking for and it cannot be displayed.

I wonder what might be going on. I call the site by IP: 192.168.0.103 from my note book and the IIS is on my Desktop in another compartment of the house. The network is wireless, with only two points. Note and Desk.

Man web.config is in the default setting, no modifications.

<?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=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-Teste_Javascript-20150527041121.mdf;Initial Catalog=aspnet-Teste_Javascript-20150527041121;Integrated Security=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <authentication mode="None" />
    <compilation targetFramework="4.5.1" />
    <httpRuntime targetFramework="4.5.1" />
    <pages>
      <namespaces>
        <add namespace="System.Web.Optimization" />
        <add namespace="Microsoft.AspNet.Identity" />
      </namespaces>
      <controls>
        <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
      </controls>
    </pages>
    <membership>
      <providers>
        <!--
          ASP.NET Membership is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
        -->
        <clear />
      </providers>
    </membership>
    <profile>
      <providers>
        <!--
          ASP.NET Membership Profile is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
        -->
        <clear />
      </providers>
    </profile>
    <roleManager>
      <!--
            ASP.NET Membership Role is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
        -->
      <providers>
        <clear />
      </providers>
    </roleManager>
    <!--
            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.
      -->
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
      <providers>
        <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
      </providers>
    </sessionState>
  </system.web>
  <system.webServer>
    <modules>
      <remove name="FormsAuthenticationModule" />
    </modules>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
</configuration>

See what I changed on IIS to solve the problem. inserir a descrição da imagem aqui

By selecting the option in the combo section to unlock, already gives this error inserir a descrição da imagem aqui

  • Only with this information can you guess solutions.

  • You can edit your question and put the file web.config in it, please?

  • This link solved my problem by only installing more resources http://stackoverflow.com/questions/25821187/how-to-solve-http-error-500-19-internal-server-error-remove-name-extensio

  • I solved my problem by this answer: Click Here

1 answer

11

The actual error you are getting as your screenshot is:

This configuration section cannot be used in this path. This occurs when the section is locked on a parent level. Lock is by default (overrideModeDefault="Deny"), or is explicitly defined by a local tag with overrideMode="Deny" or the inherited allowOverride="false".

This error is happening because the web.config of its application, located in c:\Inetglobal\Site\web.config is trying to override module settings (system.WebServer\modules) IIS, which is locked for editing in lower level . config files. To get around the error, do the following:

  • Open the IIS Manager
  • In the treeview on the left, click on the server (usually the name of your computer)
  • On the main panel, click Settings Editor (Configuration Editor)
  • In the combo of Sections (Sections), select the section giving error (system.webserver/modules)
  • In the right pane (Actions or Actions), click on Unlock Attribute (Unlock Attribute)
  • If an error occurs in another section repeat the last two steps for it
  • Restart the OSI
  • Dude, I did that and the error continues. I’m gonna edit the question and post what I did.

  • Marcus Vinicius, Thanks for the great explanation! was with the same problem and solved quickly.

  • It’s funny that the answer helps but I’m still negative, I assure you the solution has already solved the problem of some people...

  • I did exactly what you said, when I click system.webserver/modules it informs me the error, and enables nothing to put in the right panel.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.