aspx giving 404 errorsRSS

14 replies

Last post Dec 06, 2006 07:05 PM by sontek

  • aspx giving 404 errors

    Nov 05, 2006 02:22 PM|rmagers|LINK

    I'm getting 404 errors in any aspx page when asp.net is set to 2.x on the virtual directory. I've tried the simple pages.. asp pages are fine. The basic aspx page will work when set to 1.X. I've checked the components and all are allowed. All the pages work fine on a development server, once I copy the directories to a 2000 server, iis 5  or a 2003 server iis 6 the files do not work any more..

     Default.aspx

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            Test</div>
        </form>
    </body>
    </html>

    default.aspx.vb


    Partial Class _Default
        Inherits System.Web.UI.Page

    End Class

    web.config

    <?xml version="1.0"?>
    <!--
        Note: As an alternative to hand editing this file you can use the
        web admin tool to configure settings for your application. Use
        the Website->Asp.Net Configuration option in Visual Studio.
        A full list of settings and comments can be found in
        machine.config.comments usually located in
        \Windows\Microsoft.Net\Framework\v2.x\Config
    -->
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
     <appSettings/>
     <connectionStrings/>
     <system.web>
      <!--
                Set compilation debug="true" to insert debugging
                symbols into the compiled page. Because this
                affects performance, set this value to true only
                during development.

                Visual Basic options:
                Set strict="true" to disallow all data type conversions
                where data loss can occur.
                Set explicit="true" to force declaration of all variables.
            -->
      <pages>
       <namespaces>
        <clear/>
        <add namespace="System"/>
        <add namespace="System.Collections"/>
        <add namespace="System.Collections.Specialized"/>
        <add namespace="System.Configuration"/>
        <add namespace="System.Text"/>
        <add namespace="System.Text.RegularExpressions"/>
        <add namespace="System.Web"/>
        <add namespace="System.Web.Caching"/>
        <add namespace="System.Web.SessionState"/>
        <add namespace="System.Web.Security"/>
        <add namespace="System.Web.Profile"/>
        <add namespace="System.Web.UI"/>
        <add namespace="System.Web.UI.WebControls"/>
        <add namespace="System.Web.UI.WebControls.WebParts"/>
        <add namespace="System.Web.UI.HtmlControls"/>
       </namespaces>
      </pages>
      <!--
                The <authentication> section enables configuration
                of the security authentication mode used by
                ASP.NET to identify an incoming user.
            -->
      <authentication mode="Windows"/>
      <!--
                The <customErrors> section enables configuration
                of what to do if/when an unhandled error occurs
                during the execution of a request. Specifically,
                it enables developers to configure html error pages
                to be displayed in place of a error stack trace.

            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->
     </system.web>
    </configuration>

     

    Error:

    Server Error in '/test1' Application.
    --------------------------------------------------------------------------------

    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /test1/Default.aspx
    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

  • Re: aspx giving 404 errors

    Nov 06, 2006 03:47 AM|mvolo|LINK

    Can you confirm that the virtual directory points to the right physical location on disk, where your default.aspx page is present?

    If you set this virtual directory to use ASP.NET 1.1 on the production servers, does it work?

    Thanks,
    Mike Volodarsky
    CTO at LeanSentry
    Former IIS/ASP.NET PM

  • Re: aspx giving 404 errors

    Nov 06, 2006 08:11 AM|rmagers|LINK

    It gave a different error on the site. Probably because the site has to use 2.0. Once thing I did find, if I create a directory make that the default IIS directory, then put the site into a sub directory under it, everything works. e:\websites would be the IIS default, then e:\websites\site\ for the website. .net 2.0 functions. Is there something with .net 2.0 working at a root drive?

     

     

  • Re: aspx giving 404 errors

    Nov 06, 2006 11:57 AM|jeff@zina.com|LINK

    ASP.NET works fine in the root, provided you configure the root as an application (it is by default) and the application uses the correct ASP.NET version.  In Server 2003 you want to run separate versions in separate app pools as well.

    Is there a subcode to the 404, such as 404.1, etc.?  Check the code again as well, it may really be a path error.  Security issues can result in a 404 too.

    Jeff

    Have you Binged a solution before posting?
  • Re: aspx giving 404 errors

    Nov 06, 2006 12:19 PM|rmagers|LINK

    On IIS 5.0  /tse/uriadmin/edituser.aspx - 404

    On IIS6.0  404 0

    Once in a subdirectory then set as an application using .net 2.0 it's fine, as long as the default web site is point to a subdirectory such as e:\websites then the app is e:\websites\tse

    It's only 2.0 apps not 1.1

     

  • Re: aspx giving 404 errors

    Nov 07, 2006 08:12 AM|tomkmvp|LINK

    A straight-up 404 0 simply means the files are not found.
    http://support.microsoft.com/kb/318380

    Are you sure you have the paths correct?

    Tom Kaminski (former IIS MVP 2002-2010)
    http://mvp.support.microsoft.com/
  • Re: aspx giving 404 errors

    Nov 07, 2006 08:45 AM|rmagers|LINK

    Paths are perfect. asp and html files work fine in the directory.
  • Re: aspx giving 404 errors

    Nov 07, 2006 09:57 AM|tomkmvp|LINK

    Very bizarre.
    Tom Kaminski (former IIS MVP 2002-2010)
    http://mvp.support.microsoft.com/
  • Re: aspx giving 404 errors

    Nov 07, 2006 10:03 AM|tomkmvp|LINK

    rmagers

    Once in a subdirectory then set as an application using .net 2.0 it's fine, as long as the default web site is point to a subdirectory such as e:\websites then the app is e:\websites\tse
    ... I missed this part ...

    You're saying that the root of the web site is set to E:\ ?  I've never seen anyone do this and it's probably not a good idea.  I've always used a folder as the root, never the root of a drive.  Do you have to use the root of the drive?

    Is this how your doing it on the development server? What are the NTFS permissions of that server vs the ones that don't work?

    Tom Kaminski (former IIS MVP 2002-2010)
    http://mvp.support.microsoft.com/
  • Re: aspx giving 404 errors

    Nov 07, 2006 12:28 PM|rmagers|LINK

    On the Windows 2000 server with IIS5. e:\ is the main website folder. I cannot change that. I moved the site to a WIndows 2003 server with IIS6. With the server, the main website directory starts at e:\websites. Once I put the new website under a sub directory, .net 2.0 works. Looks to me like .net 2.0 doesn't like IIS being at a root drive.

    The development server root website sits at a subdirectory. All permissions are the same on all servers. 

     

    Ron

  • Re: aspx giving 404 errors

    Nov 07, 2006 01:57 PM|tomkmvp|LINK

    rmagers

    Looks to me like .net 2.0 doesn't like IIS being at a root drive.
    Sure looks that way.
    Tom Kaminski (former IIS MVP 2002-2010)
    http://mvp.support.microsoft.com/
  • Re: aspx giving 404 errors

    Nov 07, 2006 02:16 PM|rmagers|LINK

    I'm going to setup a new test server with only .net 2.0 at the root drive and see if that causes an issue.

     

     UPDATE: Configured new Win 2003 Server with IIS 6. Loaded .net 2.0.  Tried website at root level (d:\web\). .Net 2.0 apps do not work. Created subdirectory and set default web server to the sub. Website works with .Net 2.0 at this level. (d:\websites\web\)

     

     

  • Re: aspx giving 404 errors

    Dec 06, 2006 12:49 PM|sontek|LINK

    This issue comes up in 2003 because after you install ASP.NET 2.0 it disables it in the Webservices Extensions, If you enable it then it should work just fine
    Sontek Blog: http://blog.sontek.net
  • Re: aspx giving 404 errors

    Dec 06, 2006 02:15 PM|rmagers|LINK

    Wonder why it happens in Windows 2000 Server also?

  • Re: aspx giving 404 errors

    Dec 06, 2006 07:05 PM|sontek|LINK

    Well, It might do it in 2000 too, I run all 2k3 here.    The other issue you will see is if you are running .net 1.1 and .net 2.0 code you'll want to create different application pools for each
    Sontek Blog: http://blog.sontek.net