I have and IIS website which consists of just index.html
and web.config
. I want to override the request process based on certain conditions. Thus I found a tutorial and wrote my handler by creating a new Class Library:
namespace skmHttpHandlers
{
public class SimpleHandler : IHttpHandler
{
public void ProcessRequest (HttpContext context)
{
context.Response.Write ("<html><body><h1>Test</h1></body></html>");
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
I built the library and copied skmHttpHandlers.dll
into the folder where index.html
and web.config
resides. Unfortunately it doesn't find my handler and shows an error:
Could not load file or assembly 'skmHttpHandlers' or one of its dependencies. The system cannot find the file specified.
My web.config looks like this:
<configuration>
<system.webServer>
<handlers>
<add name="SimpleHandler" path="*" verb="*"
type="skmHttpHandlers.SimpleHandler, skmHttpHandlers"
resourceType="Unspecified"
requireAccess="Script"
preCondition="integratedMode" />
</handlers>
</system.webServer>
</configuration>
What am I doing wrong?