Setting up a simple website with IIS - asp.net

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.

Related

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

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.

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.

IIS 7 Wont Open My Aspx Files

I am new to IIS and it is annoying the hell out of me!
I have an asp.NET website that runs beautifully on visual studio 2010, so what i do, is publish the website, put the published website folder in the inetpub/wwwroot folder, connect all the dots, then in my browser i type in http://localhost:8080/A3Media/ and it brings up my index.html page. So the IIS is working correctly because it happily displays .html files. but when i try and access a .aspx file in my website. I get i weird 404 error saying the document doesnt exist. When it obviously does exist because... I checked... multiple times!
So i deducted that my IIS doesnt like .aspx files or anything to do with asp.NET.
So i make sure that i have all the asp.net modules installed by following the usual "windows features" and making sure the asp.net folder is ticked and installed, along with all the depending asp.net folders.
and my website still doesnt work.
have i missed something?
i have no idea:(
One of two options spring to mind.
Have you registered ASP.NET? aspnet_regiis.exe -i Link
cmd -> cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
C:\Windows\Microsoft.NET\Framework\v4.0.30319> aspnet_regiis.exe -i
In IIS manager - Request Filtering - Is .aspx denied?
Make sure you convert your "A3Media" directory into ASP.NET Application via IIS Manager, please see Deploying ASP.NET Websites on IIS 7.0 for more details.

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

Getting 404 with locall IIS 7 served page

My setup:
Vista 64-bit PC (my local PC)
IIS 7 obviously
VS 2008
I setup a new "Application" manually under the IIS default site. It's running.
The application is pointing to the correct directory (where my default.aspx exists)
I've setup this same exact setup on our dev server running Server 2008 and it runs fine
But for me, when I go to http://localhost/MyAppName I get a 404 not found.
I have no clue why.
So since that did not work and still got a 404, then I tried instead changing from using the VS web server to using IIS in my web project properties in the "Web" tab in VS 2008. Then clicked the "Create Virtual Directory" button and it created a new Application in IIS for me. Same thing though. If I go to that address, I get a 404 on my local machine where it's running.
Ok, I had not installed the IIS 6 functionality of IIS in Vista. I did not know it still used legacy features in IIS 7 to run sites locally....I guess. Not sure why but I guess it uses these IIS6 features. Will have to research why it's dependent on this stuff.
Do you have the home directory to look for "default.aspx" as the default page?
A couple things to check:
First, look at your access logs to see exactly what request is getting logged.
Check your IIS config - you may have a default.aspx page, but is IIS configured to use that as one of the default pages? If you go to http://localhost/AppName/default.aspx do you still get a 404?
If you put a static test.html file in the same directory, can you access it?
These should all help determine the cause.

Resources