There are three things in your code that I usually forget:
- class
public - it extends
TcmExtension - has the
TcmExtension attribute
If you correctly registered the class in the configuration file, you just need to restart the corresponding module (s). In this case, I expect these to be the Publisher and TcmServiceHost services.
After restarting these modules and starting the publishing action, you should see a registered event (in the Windows Event Viewer) in which your extension is loaded.
Even if it shows, it means that your assembly is loaded into the corresponding Tridion process, and the class is recognized and an instance is created.
If at this point your handler does not fire, you may need to consider listening to another event. Whenever I want to interact with a publication, I end up listening to SaveEventArgs PublishTransaction instead of PublishOrUnPublishEventArgs on Page .
source share