Search code examples
iisasp.net-core.net-corekestrel-http-server

Configure IIS for enabling directory browsing without Kestrel to hijack route


I have a simple asp.net core application on my computer hosted on my IIS. Let say I have a site on my computer like this:

https://computername/application

I have a virutual directory called logs.

So for https://computername/application/logs I want to be able to directory browse, but when I go to /logs the app return 404, and I think that is because Kestrel doesn't find a route to /logs.

How can I make the IIS handle the /logs instead of Kestrel?

I think it should be possible to handle this in web.config but I have no idea how.

the directory browsing setting is enabled in IIS for the site so that's not the problem.

I hope you understand my problem, otherwise I can gladly elaborate. Thanks!


Solution

  • Solved it with adding a web.config at the virtual folder.

    <configuration>
       <system.webServer>
           <handlers>
               <remove name="aspNetCore" />
            </handlers>
       </system.webServer>
     </configuration>