ashx 404 error

Discussion in 'General troubleshooting' started by jasonc, May 9, 2010.

  1. I'm getting a 404 error when trying to access all of my ashx resources.

    I have this in my web.config

    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add verb="POST" path="login.ashx" type="PaperBees.Server.Login, PaperBees.Server"/>
    <add verb="POST" path="createuser.ashx" type="PaperBees.Server.CreateUser, PaperBees.Server"/>
    <add verb="POST" path="createcontact.ashx" type="PaperBees.Server.CreateContact, PaperBees.Server"/>

    The PaperBees.Server.dll is in the Bin directory of my site.

    Do we have access to the application log files on the server ? I can't tell if anything is going wrong or if it's a configuration issue. I've tried setting up log4net but that doesn't seem to be spinning up either.

    All aspx files are served up ok, so there are no errors parsing the web.config.

    Thanks in advance for any help
  2. Ray


    Give us a URL where we can see this error message.
  3. Thanks for the response Ray. Are there any server logs I can access ?

    URL is here:

    Note that this is only accessible via POST (as specified in my web.config)

    Request/Response trace:
    POST /createuser.ashx HTTP/1.1
    Accept: application/json
    Accept-Language: en-us
    x-request: JSON
    x-requested-with: XMLHttpRequest
    Content-Type: application/x-www-form-urlencoded; charset=utf-8
    x-app-id: <pb>
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; InfoPath.3; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E)
    Content-Length: 53
    Connection: Keep-Alive
    Pragma: no-cache

    HTTP/1.1 404 Not Found
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Server: Microsoft-IIS/7.0
    X-AspNet-Version: 2.0.50727
    X-Powered-By: ASP.NET
    Date: Mon, 10 May 2010 01:32:09 GMT
    Connection: close
    Content-Length: 3388

    Exception is:
    [HttpException]: The file '/createuser.ashx' does not exist.
    at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
    at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
    Last edited by a moderator: Oct 14, 2015
  4. Ray


    No. I'm afraid there is no server log we can give you. Bear in mind that this is a shared hosting environment. To give you access to the Servers event logs means you will see other accounts as well.

    The error is fairly straight forward. It doe sound like the files your application is looking for is not loaded to the server or the path in which it is looking at is incorrect. First off, make sure every file is uploaded to our server and under your root. Then check the code and make sure the path is correct.

    When I pull up the URL

    I get an error...

    Server Error in '/' 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: /login.ashx

    Make sure this page is loaded to our server.
    Last edited by a moderator: Oct 14, 2015
  5. The ashx isn't a page, it's a mapping. For the sake of anyone else having issues with this, the problem was a configuration problem in the web.config. IIS 7 requires that the handlers are declared in 2 different sections: system.web and system.webServer. I was missing the declaration in system.webServer.

    I read in the forums that log4net should work and be able to write files under the web root. Any gotchas to be aware of with using log4net within the Winhost shared server environment ?
    Last edited by a moderator: Oct 14, 2015

Share This Page