Start site in IIS is returning error 500

2

TryingtolearnhowtosetupawebsiteinIISbyenteringtheURLofthesite,itgivesthefollowingerror:

  

ServerError

    

500-Internalservererror.Thereisaproblemwiththefeaturethat  youarelookingforitanditcannotbedisplayed.

Iwonderwhatmightbehappening.IcallthesitebyIP:192.168.0.103frommynotebookandIISisonmyDesktopinanotherhousecompartment.Thenetworkiswireless,withonlytwopoints.NoteandDesk.

Myweb.configissettothedefaultsetting,withnomodifications.

<?xmlversion="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've changed in IIS to solve the problem.

Whenyouselecttheoptioninthecombosectionforunlock,youalreadygivethiserror

    
asked by anonymous 23.07.2015 / 23:00

1 answer

4

The actual error you're getting, as your screenshot is:

  

This configuration section can not be used in this path. This occurs when the section is locked at a parent level. The lock is by default (overrideModeDefault="Deny"), or is explicitly defined by a location tag with overrideMode="Deny" or the allowOverride="false" inherited.

This error is occurring because the web.config of your application, located at c:\Inetglobal\Site\web.config , is trying to override the IIS configuration settings ( system.WebServer\modules ), which is blocked for editing in lower level .config files. To work around the error, do the following:

  • Open IIS Manager
  • In the treeview on the left side, click on the server (usually the name of your computer)
  • In the main panel, click Configuration Editor
  • In the Sections section, select the section that is giving error ( system.webServer / modules )
  • In the right pane (Actions or Actions), click Unlock Attribute
  • If you make a mistake in another section repeat the last two steps for it
  • Restart IIS
23.07.2015 / 23:40