3

I am trying to publish / deploy my site to a iis 7 server.

When I click run in visual studio it works perfectly.

I followed a tutorial to use the web deploy to my server. the files are there and everything seems ok.

but when I go to the site: http://10.0.0.12:8000/

I get: HTTP Error 403.14 - Forbidden, The Web server is configured to not list the contents of this directory.

I have given the site administrator credentials. And I checked there are default pages configured.

What am I doing wrong?

enter image description here

Here is my config File:

<configuration>
<configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
 <appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5.1" />
 <httpRuntime targetFramework="4.5.1" />
</system.web>
<system.webServer>
<modules>
  <remove name="FormsAuthenticationModule" />
</modules>
</system.webServer>
<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.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>
Zapnologica
  • 22,170
  • 44
  • 158
  • 253

2 Answers2

9

Things to try and check:

  1. Set the runAllManagedModulesForAllRequests="true"attribute on the <modules> section in your web.config:

    <modules runAllManagedModulesForAllRequests="true">
    
  2. The website is configured to use an Application Pool using ASP.NET 4.0, Integrated Pipeline mode
  3. ASP.NET 4.0 is registered in IIS. Use the following command to ensure this is the case (might need to adjust the Framework64 folder with Framework if you are on a 32 bit server):

    c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis -ir
    
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
1

Go to the web.config at the wed sites physical deployed locationand open it And you will find a an xml tag, almost at the end of the xml file, as the following content

 <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
               ....
    </handlers>
  <!--ENTER THE CODE HERE-->
  </system.webServer>

At the given location add the following code piece save and refresh ur site

<modules runAllManagedModulesForAllRequests="true">

Also Try removing any othere tags already available!

Dehan
  • 4,818
  • 1
  • 27
  • 38