Gary Dryden
Gary Dryden

Reputation: 11

AppHarbor - /order/rpc.ashx(1): error ASPPARSE: Could not create type 'web.order.rpc'

This is my first attempt at getting a project running on appharbor

The solution references a number of other project dlls. The build works locally and I am using git to push it to appharbor.

I get this message as the build fails: /order/rpc.ashx(1): error ASPPARSE: Could not create type 'web.order.rpc'.

[HttpParseException]: Could not create type 'web.order.rpc'.

at System.Web.UI.SimpleWebHandlerParser.GetType(String typeName)

at System.Web.UI.SimpleWebHandlerParser.GetTypeToCache(Assembly builtAssembly)

....

at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback, List`1 excludedVirtualPaths)

at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback, Boolean forceCleanBuild)

at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback)

at System.Web.Compilation.Precompiler.Main(String[] args)

The source code is pretty simple:

namespace web.order

{

public class rpc : IHttpHandler

{

    public void ProcessRequest(HttpContext context)
    {
        var Response = context.Response;
        var Request = context.Request;

        Response.Expires = 0;
        Response.ContentType = "text/plain";
        Response.Write("{}");

    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
}

}

Any help would greatly be appreciated

Upvotes: 0

Views: 1279

Answers (2)

Chris Walsh
Chris Walsh

Reputation: 3523

You have get this error if your ashx file's WebHandler processor instruction has in incorrect Class property. This happened to me after cloning another ashx file and not fixing up the Class property correctly.

This is what my WebHandler looked like:

<%@ WebHandler Language="C#" CodeBehind="UnrevokeLicence.ashx.cs" Class="PlatformNET.ajax.UnrevokeLicence.ashx" %>

and this is what it should have looked like:

<%@ WebHandler Language="C#" CodeBehind="UnrevokeLicence.ashx.cs" Class="PlatformNET.ajax.UnrevokeLicence" %>

Upvotes: 0

Paco Zarate
Paco Zarate

Reputation: 1995

Ok I was having the same issues than you with a precompilation of a site with a sub Web Application included on it.

The check list to solve it was:

  1. Make sure the dll for the ashx is inside the bin directory.
  2. If you are using code behind files, then make sure the cs files are included inside the folder App_Code
  3. You can try to compile the folder locally so you can see if there is something missing:

c:\windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe -v / -p "c:\your\webs\folder" -errorstack

This command helps you to check what can be wrong.

My scenario was a little different. In the remote server (IIS 7.5, I don't use appharbor) I checked the site where the project was created using:

c:\windows\system32\inetsrv\appcmd list sites

Then I checked which was the id for the site i wanted to precompile. In my sample it was 5, then i run:

c:\windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe -m LM/W3SVC/5/ROOT -c -errorstack

And it compiled.

Another way to make the compilation was copying the dll that included the ashx from the child application folder to the main site bin folder but this can derive in problems and dependencies issues.

Upvotes: 1

Related Questions