HTTP Error 403.14 - The Web server is configured to not list the contents of this directory. in .NET core 3.1 - asp.net

I have project which don't have .sln file as well. I am trying to run but facing error.
I am trying to resolve this issue by going into IIS manager. IIS manager don't have list of sites and unable to add site.
Please give me solution.
Thanks

You are most likely using IIS Express while launching the program and that is why you don't see a website in IIS.
I think you want to enable directory browsing, so look here:
How to enable Directory browsing by default on IIS Express
Just a small side note: by careful with directory browsing on public websites as it can be a huge security risk.

Related

How to configure Asp.Net Web Application with IIS

I am using Asp.Net Standard version 4.7 with MVC and attempting to deploy to IIS Express. I am facing several issues in the configuration and cant seem to find straight forward documentation for asp.Net standard. I added a website named localHost aside from Default Website in IIS. I am facing 2 issues.
When I click browse from IIS, it navigates http://localhost/Views/Home/Index.cshtml I get a 404 error.
Server Error in '/' Application. The resource cannot be found
When Debugging From Visual studio 2019 I get
Process with Id of xxxx cant be found
.
Description: HTTP 404.
I am thinking there some port configuration issue but I am unclear on how to configure.
I attached screenshots of my configuration settings.
Please follow Microsoft guideline.
You are trying to access wrong Url. Try below url to access:
http://localhost:8080/Home/Index
Maybe you are misunderstand MVC, you should visit a restful path in mvc instead of cshtml, just like this: http://localhost:8080/Home/Index -> to find /Views/Home/Index.cshtml in you solution.
To host the site .net application you need to publish it and use that publish folder as site folder path in iis.
1)open visual studio, select your project.
2)right-click on your project and choose publish:
3)in publish target select folder and create a new folder in c or another drive where can you access the folder.
4)click on the publish
5)open iis and create a new site
6)choose the folder path and site binding
7)browser your site.
Note:
Assign iis_iusrs and iusr full permission to the site folder. you need to set the physical path credential with your Gmail account.

Setting up a simple website with IIS

I am trying to create an ASP.NET MVC 4 website and serve it with IIS 7.5. So, I build it in Visual Studio, and then publish the code to a directory. In IIS Manager, I create a new website, whose physical path is the publish directory. The bindings are http:*:80:.
However, when I try to reach the website by typing in the name of my machine on a browser, I get the following error message:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
What's going on here?
Karnivaurs
Try to use "localhost" or the loop back ip "127.0.0.1" to get to the site.
For the browsing, If its available in IIS then you have to enable it. See here
I wonder if you have the same issue that happened with this question, it solved my problem with IIS on Windows 8
MVC 4 website with .NET 4.5 on IIS 8 in Windows 8 gives 403.14 forbidden error
Does it work when you run it straight from visual studio? Do you have home/index? To enable directory browsing in IIS , you need to double click on Directory Browsing and Enable it. That way you can see the content of the directory. After that, you can browse to your html page.

Changing "Project Url" causes ASP.Net Web app to not be debuggable

I have an ASP.NET Web Application project that I am using to host a WCF Data Services (OData) project.
I went and changed the url from:
http://localhost/MyProject
to
http://localhost/v1/MyProject
after I did that I created a Virtual Directory for the new project URL.
Now when I run I get this error:
Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
I clicked help but it was no help (was IIS 6 level instructions, I have IIS 7). I did some googling and it was all fairly generic responses.
How can I get this working again? (Aside from revert to my old Url. Reverting works but I changed it for a very good reason.)
Your virtual directory need to point to the same scr directory you were originally debugging against.
Also, make sure the virtual directory is configured for Windows Authentication, which is required for debugging.
I had to go to my website in IIS and add a folder under it called v1. After I did that it all worked perfectly.

How do I set up debugging under my local IIS for an MVC3 app?

My host is having issues getting my MVC3 app to work on their server, so I though I'd check it out myself. Until now I've been too busy developing under the built in server to worry about IIS, but today I tried my first deployment to the host with no joy. Then I tried one to my local IIS, with no joy. Then I tried telling VS to use IIS for debugging, to maybe resolve some local issues, with no joy.
What steps and configuration are required to use local IIS 7.5 to debug an MVC3 application?
EDIT: Going through a browser, after clearing up a permission problem for my Windows user on Temp ASP.NET Files, I now site with a I get a HTTP Error 403 (Forbidden), but the occassional basic auth login dialogue. Here I have tried a Forms auth user, my normal Windows user, and my Windows admin user, all to no avail.
When I try and debug under VS, I get a 500, internal error.
THE PLOT THICKENS: When I enable directory browsing on the site, I get a proper directory listing for the site root url. This suggests the the MVC3 routing is not working, but why not?
If you're getting a directory listing that means there's not a default file set (for IIS6). It usually means the request wasn't routed to IIS to deal with. thing are slightly different with II7 & it's integrated pipeline.
Simon

How to hide directory list in ASP.NET 3.5?

I have a ASP.NET 3.5 web site, which is password protected (form authentication). But yesterday I found I was able to browse the list of directories (which is unexpected).
I searched the web, one article said we need to config it in IIS. But I'm a developer and I'm working on my local machine (no IIS installed).
My question is: are there any way to hide them other than IIS configuration? like set web.config?
This must be configured in your webserver - you cannot handle this in the website itself. Since you are working locally it shouldn't matter that the root directory is browsable. If you need to be able to control the site in this way you really ought to set up a webserver.
if you don't have IIS, you're likely working on your local ASP.NET development server (called Cassini possibly?), in which it is only available locally, so no security worries there.
When you deploy your app, you will likely be on an IIS server, so the configuration will be available
Directory browsing in IIS is controlled in the virtual directory/site configuration.
When you deploy your application to a real server you can configure directory browsing there.
Directory browsing on your local machine shouldn't matter, but this may work for you.
In IIS6: http://blog.crowe.co.nz/archive/2006/03/18/603.aspx
In IIS7: http://technet.microsoft.com/en-us/library/cc731109(WS.10).aspx
In IIS - Website properties, Home Directory tab, untick Directory browsing.
In Cassini (the ASP.NET development server) I don't think it can be turned off. But the server only runs while your debugging.

Resources