IIS lists directory instead of opening page

Asked

Viewed 2,570 times

3

I created a website in Visual Studio 2017, clicked to publish it and copied the files to the Inetpub/wwwroot folder

However, instead of the page being displayed, the url is returning me to the list of files from within the folder:

inserir a descrição da imagem aqui

How to correct?

Follow my web.config:

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  https://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>
  <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>
    <compilation targetFramework="4.5.2" />
    <httpRuntime targetFramework="4.5.2" />
    <httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
    </httpModules>
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
      </dependentAssembly>
      <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.WebPages" 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.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
        <directoryBrowse enabled="true" />

  </system.webServer>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
</configuration>
<!--ProjectGuid: 518A8876-B620-4803-99F0-324F79C190B6-->

Configuration of the OSI

inserir a descrição da imagem aqui

  • 1

    Is this port 88 correct? And did you just create a project? Modified something?

  • 1

    I believe you need to disable listing files in directories: https://technet.microsoft.com/en-us/library/9b2f3d11-99c4-46b5-a92f-34af6909075b

  • 1

    I believe you should define the standard document to be opened, see the link: https://www.iis.net/configreference/system.webserver/defaultdocument

  • @Cassioalves door 88 is correct yes, I chose it, because 80 is busy

  • 1

    You could put up your Web.config

  • 1

    boteoo web.config

  • @Rovannlinhalis in the tutorial you gave me, asks to indicate a default file or index to be the default, but in the directory I’m not seeing this file

  • 1

    What should be the file to open your site? What was the home page you created?

  • 1

    Possibly is inside the for Views

  • @Rovannlinhalis is, but I don’t know how to make it standard :/

  • @Rovannlinhalis the site is in MVC, the home page is the controller Home and the View Index

  • 1

    so if you type http://localhost:88/Home/ will work ?

  • 1

    Post a screenshot of your iis > Select your website and print the screen

  • @Tiagos print da tela = http://imgur.com/a/6xkXl

  • @Rovannlinhalis if I try localhost:88/Home, the error is HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the page-related configuration data is invalid.

  • there is already a question of configuration, possibly in your .config

  • 1

    The page listing is a security issue, the problem is that there is no file type in the folder that is default to open, type a default.aspx. The default IIS open files are configured per site. This is the.net mvc or web Forms?

Show 12 more comments

2 answers

6


Your IIS is missing some resources needed.

To add these features:

Go on enable and disable windows service

Afterward

  • Internet Information Services

    • Word Wide Web Services

    • Resources for Application Development

Mark at least the features shown in the image

inserir a descrição da imagem aqui

After that it’s supposed to work.

2

Remove the line:

<directoryBrowse enabled="true" />

Or false.

  • Error appears: Error HTTP 403.14 - Forbidden The web server is configured not to list the contents of this directory. Most likely causes: A standard document is not configured for the requested URL, and the directory search is not enabled on the server.

  • 1

    The IIS is running?

  • how do I know?

  • 1

    Search by IIS in windows search, and open the manager

  • is yes, I just confirmed

  • 1

    You created a website on IIS? could you put a print of how are your sites on IIS? What if you run directly through visual studio works?

  • I created it. Which IIS screen do you want the print from? In Visual Studio normal wheel

  • 1

    Place from the home screen, showing the sites

  • 1

    The @Tiagos response will probably solve the problem.

Show 4 more comments

Browser other questions tagged

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