This project is read-only.

My Handler gets not loaded

Topics: Writing modules
Aug 2, 2015 at 11:36 AM
I placed a handler "CarHandler.cs" into my module's "handlers" folder:
 public class CarHandler : ContentHandler
        public CarHandler (IRepository<CarPartRecord> carPartRepository) 
But when starting the web application (before I also shut down IIS Express), my CarHandler gets not instanciated (a breakpoint in the constructor will not be hit and stays "white" because the symbols are not loaded).

A breakpoint in the constructor of an "out of the box" orchard module, like QueryPartHandler.cs of "Orchard.Projections", will be hit.

Even if I copy and paste my CarHandler class into the QueryPartHandler.cs file, it will be hit!

I suppose something must be wrong with my module. Do I need to enable a module to use handlers?

Thanks for any hint!
Aug 3, 2015 at 8:32 AM
Edited Aug 4, 2015 at 8:02 AM
Just checkout the logs. Your module probably has some build errors, thats why the symbols do not load. Another option is to build your module manually in visual studio, then any build errors will show up.
Marked as answer by mcmcod120 on 8/9/2015 at 5:28 AM
Aug 4, 2015 at 6:27 AM
Edited Aug 4, 2015 at 6:28 AM
Thanks sanderg! That solved my problem. There was a build error in my module that I did not see. Now the handler loads perfectly :-)