Getting 404 with locall IIS 7 served page - asp.net

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.

Related

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.

ASP.NET and IIS 7.5 - HTTP Error 403.14 - Forbidden

I try to configure IIS 7.5 on a new server (Windows Server 2008 R2), in order to run an ASP.NET 4.0 application. Two "domains" are defined on the server (managed with Parallels Plesk), each one appearing as a site in IIS. One domain is for the public site, the other is used for tests. At the present time, the DNS of the test site points to that new server while the DNS of the public site still points to our old server. We transfer the test site first, to see if everything is OK, before transfering the public site to the new server.
Pointing to the test site in IIS, if I run the Browse command on the folder of the application, I get the HTTP Error 403.14, with the message: The Web server is configured to not list the contents of this directory. The strange thing is this: if I put the exact same folder structure in the other domain on the same server, and I run the same Browse command, I see the default page of the application (I don't know if everything works after that but, at least, the first page shows up as expected). I should add:
Both sites use the same application pool.
Both sites have the same permissions (I checked one by one, also compared with cacls)
The default page is not set in IIS but is the authentication form specified in Web.config
So, same setup but different results. I don't know if there is something else that I should check. I am on very shaky ground when I talk about server configuration and IIS; so I hope that this description is clear enough and makes sense.
I think I found it. It probably doesn't work for both sites on the new server. When I run the Browse command, it shows the page in IE using the DNS of the site. Since the DNS of the public site still points to the old server, the page displayed in IE is not from the folder that I clicked, but rather from the old server site.
I can now look for standard solutions to the 403.14 problem on the new server...

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

asp.net setting up subdomain on localhost

I added the following entries in the HOSTS file.
127.0.0.1 abc.localhost.com
127.0.0.1 xyz.localhost.com
Using the VS2010 ASP.NET Development server I am unable to run or execute the website.
When browsing http://localhost:2687/TestProject/ it shows up the default.aspx page. But when accessing http://abc.localhost:2687/TestProject/ it shows a website cannot be found page.
Is there anything else to be done when setting up subdomain on localhost.
EDIT: To make this work I removed the .com and in IE-->Connections-->LAN uncheck everything. Subdomains with port works are correctly getting forwarded. Nothing else need to be configured.
Obvious mistake is that in your hosts file you have abc.localhost.com, whereas you are browsing to http://abc.localhost/folder
Not the same thing.
Not sure this will work as you intend anyhow. I would also recommend IIS Express, part of WebMatrix, which I think is still in beta, or just use IIS. IIS 7+ on Vista, W7, Server 2008 is all really easy to use.
Use IIS or IIS express, rather than Cassini. (For several reasons, which you can google or look for on stackoverflow)
With the IIS you can easily add a hostheader entry to you webapplication with just 2 clicks.
Be aware, that you are assigning both a Url and a port.
So adding abc.localhost won't allow you to browse abc.localhost2687, just the default port (80). If you also want to browse to abc.localhost:2687 you need to a a hostheader entry according to that that Url and port.
This screenshot shows you the dialog to add hostheaders (the picture is from IIS 6, but in IIS 7 or IIS 7.5 it looks very similar)

ASP.Net MVC2 - IIS7.5 doesn't find view file for home page

We have a mid-sized asp.net project that we just promoted from our dev server (Windows 2003) to an external test server (Windows 2008 R2).
On the test server, IIS is not finding our home page, which is located in the views/home folder (404 error). As far as we can tell, the settings are the same on both servers. I've confirmed HTTP redirection is installed.
Is there perhaps some critical configuration we may have missed on IIS7.5 to let it know where to find the view and/or home page?
What do you mean by "not finding"? Are you getting 404 error?
I had a similar situation which was related with bad install of ASP.NET on windows 7 machine, so I would recommend you to:
Check if ASP.NET is installed on server
Run aspnet_regiis to check that ASP.NET correctly registered with IIS
We changed the App Pool for 4 classic to 4, seemed to fix the 404 issue.

Resources