HTTP Handlers and SharePoint 2010

Trying to debug an error on a HTTP handler, we got the following error message:

Parser Error Message: Could not create type ‘MyNameSpace.MyClass’.

The HTTP handler directive on the ASHX file looked like this:

<%@ WebHandler Class="MyNameSpace.MyClass" %>

I found the solution for this issue at

The explanation:

Since we are using SharePoint 2010, the HTTP handler was deployed to the LAYOUTS folder. The trick here is that SharePoint needs to load all its referenced assemblies from the GAC and in this case the assembly was in the GAC but we were not referencing the FQDN of the assembly.

The ASHX file should look like this:

<%@ WebHandler Class="MyNameSpace.MyClass, MyAssembly, Version=, Culture=neutral, PublicKeyToken=7c8e2c3ef53023ee" %>

After updating the ASHX file the error was solved.

See you,



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: