Hello.
I'm developing a plugin for the Kentico CMS 7. I had downloaded trial version of Kentico 7.0 (KenticoCMS_7_0.exe) from your site in the previous week. I installed it as a web-application; installation was successful, all works fine, I use "localhost" domain in order to use 30-day trial without limitations. I use only one sample site - "Intranet Portal".
My plugin requires using a lot of HTTP-handlers (implementation of IHttpHandler interface). I have a distinct assembly (class library, DLL) with already defined HTTP-handlers and I must use them in the plugin. I successfully added this DLL to the Kentico project in Visual Studio, stated all paths to the HTTP-handlers in the web.config and ... nothing works.
I tried to use both IIS 7.5 (Windows 7) and ASP.NET Development Server, Classinc and Integrated pipeline in the IIS - in all cases my requests to the HTTP-handlers have a "HTTP 404 Not Found" response. Then I decided to write my own custom test HTTP-handler in the Kentico project:
namespace CMSApp.GDViewer
{
public class MyHttpHandler : IHttpHandler
{
/// <summary>
/// http://go.microsoft.com/?linkid=8101007
/// </summary>
public bool IsReusable
{ get { return true; } }
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "next/plain";
context.Response.Write("Just simple and test text response");
context.Response.End();
}
}
}
And web.config inclusion:
<add name="MyHttpHandler" verb="GET" path="myhttphandler" type="CMSApp.GDViewer.MyHttpHandler"/>
Nothing helps - only 404. Then I had created new HTTP-handler "MyHttpHandler2" with the same code, but not as a ".cs" file, but as a ".ashx" and without path inclusion in the web.config. And yes, when requesting its full path - "http://localhost/GDViewer/myHttphandler2" - it works fine.
Then I had found the next thing. When IIS returns "HTTP 404.0 - Not Found" when requesting HTTP-handlers, it also returns additional information, with next:
Module: CMSApplicationModule
Notification:MapRequestHandler
Handler:MyHttpHandler
Error code:0x00000000
"CMSApplicationModule". Hmm. I had found tis HTTP-module in the web.config
<add name="CMSApplicationModule" preCondition="managedHandler" type="CMS.CMSHelper.CMSApplicationModule, CMS.CMSHelper" />
and deleted/commented it. And voila - all my HTTP-handlers, both developed by myself in this project and located in the external DLL - work successfully. All paths to the HTTP-handlers are valid.
But the main site - not.
Server Error in '/' Application.
[SystemMethods]: System events are not initialized. You must call CMSContext.Init() before running any of your methods. In web application, the web.config file must contain registration for the CMSApplicationModule: <add name="CMSApplicationModule" type="CMS.CMSHelper.CMSApplicationModule, CMS.CMSHelper"/>
So, my question is the next. How to use my own HTTP-handlers with paths defined in the web.config in the Kentico project? When disabling "CMSApplicationModule" all HTTP-handlers work fine, but the site itself - not. What to do? Please help, answer to this question is vital for me.
Denis.