Clicky

Let me start by saying that I am a windows forms developer by trade. So, I may be missing something obvious.  I recently built an asp.net website for someone. It works fine while testing on my local machine (visual studio, etc).  So, I deployed the website to a local directory, and then copied that directory on to their web server where other websites are running fine.  However, I keep getting an http 404 error when trying to access the site. Another thing to note is that we deployed this as an application on the default web site.

Things that I have checked:
1. Actual URL is correct (I checked the physical path as well as the virtual path from IIS Manager)
2. Actually tried setting permissions on the physical folder to Everyone: Full Control (just for debugging), but it did not work
3. The log file shows it as http 404 error substatus 0

Any ideas?  I really don't know what else to check.

asked 12/12/2011 02:55

anderde's gravatar image

anderde ♦♦


17 Answers:
Did you set it up the Initial page for your sub directory on the IIS where you deploy your application? Sound like doesn't find the page under the subdirectory that you're browsing.
link

answered

k-designers's gravatar image

k-designers

I'm not exactly sure if this is what you're asking, but...

I have a Default.aspx page in my application that simply re-directs to the Login.aspx page (my initial page).  Is that what you are talking about?

However, I can put in the exact URL to the Login.aspx page and it still pops up with the HTTP 404.
link

answered 2011-12-12 at 11:05:00

anderde's gravatar image

anderde

Which version of IIS or Server?  With the web server, you have to set permissions in both Windows and IIS to make things work.  Is your 'default' document type (html,asp,aspx,...) listed in the Documents tab for the site?  
link

answered 2011-12-12 at 11:07:54

DaveBaldwin's gravatar image

DaveBaldwin

Set the Initial page on the IIS for your subdirectory as Default.aspx and try
link

answered 2011-12-12 at 11:08:20

k-designers's gravatar image

k-designers

Dave,
We are using Windows Server Enterprise SP2 64-bit.  IIS 7.  
Using both Windows Explorer->Properties->Security and IIS Manager->Right click on my application->Edit Permissions gives the same permission access for IIS_IUSRS.  It is set to Read & Execute, List Folder contents, and Read.  Is this the correct permission that I should be checking?

k-Designers,
I tried going to IIS Manager and double clicking Default Document on the Features page of my application.  I added the Default.aspx page there.  I also made sure that Default.aspx is set in Visual Studio properties (Start Action -> Specific page) for my web application.  I hope that this is what you were talking about.

It is still not working.
link

answered 2011-12-12 at 11:13:11

anderde's gravatar image

anderde

Put this simple "Hello World" file as "Hello.html" in that same directory and see if you can access it directly without getting a 404.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
link

answered 2011-12-12 at 11:51:12

DaveBaldwin's gravatar image

DaveBaldwin

Try what DaveBaldwind told you. If this work is because your default page is redirecting to the login page and doesn't found the login page on your sub directory. Cna you post hte code of the default page or put the login.aspx page as the initial page on the IIS to see the result that you get??
link

answered 2011-12-12 at 12:21:22

k-designers's gravatar image

k-designers

Dave,

After inserting the hello world file into the webiste and re-deploying, I can pull up the helloworld.htm file.  But the aspx files do not work.
link

answered 2011-12-12 at 12:35:20

anderde's gravatar image

anderde

The Default.aspx page is in the main directory of my application (where Global.asax, Web.config, etc are).  The Login.aspx page is in a sub-directory titled Login of my application.  The following is the code-behind for Default.aspx:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MyApp.WebUI
{
  public partial class Default : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      Response.Redirect("Login/Login.aspx");
    }
  }
}


Please keep in mind that I have tried referencing my site from IE by directly calling the Login page as well.  I put the helloworld.html file in the same Login directory as my Login.aspx file.  If I call the URL of the helloworld file directly, it works; if I call the Login.aspx file directly, it gives me the HTTP 404 error.
link

answered 2011-12-12 at 13:10:33

anderde's gravatar image

anderde

One other check.  You are accessing this thru your web browser and not as a file share, right?  It would be like "http://webserver/helloworld.htm" in IE or some other browser.  I ask because ASPX will not work thru a file share connection, it must go thru the web server.
link

answered 2011-12-12 at 13:19:42

DaveBaldwin's gravatar image

DaveBaldwin

Yes, I am accessing it by opening up IE on the actual server that is hosting the website.  I pull up IE and type in the URL:

http://{Server's IP}/{Virtual Directory Name}/Login/Login.aspx

Remember that the helloworld.html worked for the following URL:

http://{Server's IP}/{Virtual Directory Name}/Login/helloworld.html
link

answered 2011-12-12 at 13:22:20

anderde's gravatar image

anderde

Good, just checking.  Some people have tried to get to their files by typing \\servername\helloworld.html and if that works, they try \\servername\Login.aspx and that doesn't work.

Do you have a 'default' document in the server root at http://{Server's IP}/ ?
link

answered 2011-12-12 at 13:27:39

DaveBaldwin's gravatar image

DaveBaldwin

We finally found the problem.  The culprit was the AjaxControlToolkit.  For some reason, when I published the site, it did not publish some of the Ajax stuff. We published it from a different laptop that has the Ajax kit installed (I just had references to some dll's), and it worked.  So, apparently I need to actually install the Ajax Toolkit instead of just referencing the dll's in a shared library.

Thanks for your help.  This has made me pull my hair out.
link

answered 2011-12-12 at 14:10:49

anderde's gravatar image

anderde

I don't really understand the point system on this website.  If you want, I can award you the points, Dave, since you have stuck by me through this.

Should I click "Accept Solution" on my answer or one of yours??  I am just happy to have this problem solved.  

Once again, thanks for your help, Dave and k-designers!!
link

answered 2011-12-12 at 14:11:43

anderde's gravatar image

anderde

You know, I have only asked one or two questions so I don't know.  Your comment ID:37275839 is the answer.  I'm glad to help you but I don't need any points for this.  Assist points if anything.
link

answered 2011-12-12 at 14:14:39

DaveBaldwin's gravatar image

DaveBaldwin

Is true. You solved and also put the solution that you found. We only try to help you. I'm in the same position of Dave.
link

answered 2011-12-12 at 14:17:40

k-designers's gravatar image

k-designers

Thank you Dave and k-designers for your direction and suggestions.

link

answered 2011-12-12 at 14:20:08

anderde's gravatar image

anderde

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×102
×10
×30

Asked: 12/12/2011 02:55

Seen: 336 times

Last updated: 12/17/2011 05:19