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

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.

Related

HTTP Error 404 when trying to browse aspx

I am trying to browse some aspx pages which are part of MVC application.
I have tried the usual steps such as installing asp.net using aspnet_regiis.exe -i -enable to no avail.
Weird things is that its working fine in the development environment but failing in our UAT environment. Same machine/environment as far as I can see. Only difference I can see is that when I look at the contents view in IIS for the folder holding the aspx pages, on dev the type of the files says ASP.NET Server Page whereas on UAT it says ASPX File. Everything else seems to be the same on both machines.
Server details: Windows Server 2008R2 Standard Service Pack 1
All help greatfully appreciated.

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 Friendly URLs 404 errors

When I start a web app by loading a page deep in the site, I consistently get a 404 error when using ASP.NET Friendly URLs.
I can reproduce this by:
Start web app by loading page in website root
Navigate to page such as /Manage/ViewEmployee/1
iisreset
Reload page /Manage/ViewEmployee/1
Step 4 will always result in a 404 error. I can reproduce this consistently in my test environment:
Windows 2008 R2
IIS 7.5
ASP.NET 4.5
Microsoft ASP.NET Friendly URLs 1.0.0
I cannot reproduce this issue, however, with IIS Express on Windows 7.
Are there any web.config settings that I can add to address this with IIS 7.5?
Were you able to load the page in the first place by entering the URL in the browser? I suspect the issue to be a problem with the URL and not with the IISRESET. Since you are using the latest version of IIS, there should be no problems with the settings too for handling friendly url's.

asp .net 4.0 app on IIS7 Error 404.17

I am having a problem setting up a website under IIS 7. I have created an application and the application pool for the application. Application pool is using .Net Framework 4.0 as my .net app is written in .Net Framework 4.0. Application pool is set to use classic Pipeline Mode. MIME Types have been automatically added to .asp & .aspx.
When I run the website windows explorer is showing me "View Downloads" and trying to download "application name localhost" when it downloads the file I notice that its the html of my default.aspx. I have checked Default Document and it contains Default.aspx.
If I remove .asp & .aspx MIME Types then I get an error: HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler.
I have seen this problem many times. IIS is not serving aspx pages and most likely is not running for the entire server or that site.
For the entire server: Check to see if iis world wide web service is running.
For the site alone: Hit run inside IIS.
You can easily know if IIS is running properly by going to IIS and hit the browse option from inside a web site.
With the data you have put these are the things I would try in order if I were you:
Check in Server Manager/ Features if ASP.NET is installed (ServerManager/Roles/Web Server(IIS) look for ASP.NET
Check IIS Manager if everything is ok by:
Try to browse a test.html file to see if you are able to browse normal
Check Basic settings by clicking Test Settings
Check Handler Mappings to see if aspx is there.
Try to browse a sample test.aspx page with test data.
Check Application pool settings.
Reinstall Framework 4.0
Reboot machine ( a classical)
If you gave us more info and/or the ouput of my proposed tests maybe can help more. Good Luck :)
I had the 404.17 error happening on a server today. As you and cad mentioned, I checked the framework of the Application Pool that my site was using to make sure it was set to ASP.Net 4.0, and it was. What happened in my case is that my site was not using the application pool that I thought it was. My site was nested under another site, meaning my site pointed to a subfolder but another site was pointing to the root folder. Even though I had my site set to use the ASP.Net 4.0 Application Pool, the root site used a different Pool that had ASP.Net turned off, it was set to "No managed code". When I set the framework to 4.0 for the Pool the parent site was using, then my site started working.
In my case the solution was fixing the Handler mappings as explained here: http://forums.iis.net/post/1943489.aspx
IIS Manager->high-light you web site->click Handler Mappings icon on
the home pane->click Revert to Parent...
on the right Actions pane

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