3

I've written some Tridion 2011 SP1 Event System Code to subscribe to the Structure Group save event but the breakpoint is not getting hit:

EventSystem.Subscribe<StructureGroup, SaveEventArgs>(SaveStructureGroupEventHandler, EventPhases.Processed);

In the same events code project I have successfully written and subscribed to the Page PublishEventArgs with no problems:

EventSystem.Subscribe<Page, PublishEventArgs>(EventHandler, EventPhases.Initiated);

Interestingly, when I save a Structure Group in the above Page Publish Event code then the Structure Group save event get's caught but not when it is saved through the CME?

What is the correct event to subscribe to when you save a Structure Group through the CME?

  • 1
    Did you stop the COM+ application and restart the TCM Service Host service after deploying your new Event System DLL? – Bart Koopman Aug 14 '13 at 13:42
  • Yes, I've got a script to do that every time I build and deploy the updated DLL – Ryan Durkin Aug 14 '13 at 13:46
  • I'd double check that script, because I bet that when you reboot the server it's all working... or you are doing something funky with with the DLL (I've seen similar issues when it was deployed to the GAC as well as being left in the ..\Tridion\bin dir, but both were different versions). – Bart Koopman Aug 14 '13 at 13:48
  • The script is working fine. I've been using it all day for the Page Publish Events code. I've just got on to the Structure Group code and it doesn't hit the break point. – Ryan Durkin Aug 14 '13 at 15:31
  • if you don't see your breakpoint hit at debugging then look at Nuno's answer, I think you might even need to attach to the dllhost.exe process itself on 2011 for the UI related events. – Bart Koopman Aug 14 '13 at 15:48
1

Could it just be that you're attaching to the wrong process? When you do changes via the UI, these will be triggered by the w3wp.exe process, while when doing changes in the event system it will likely be triggered by the TcmServiceHost.exe process (or in some edge cases in 2011 it may still use the COM bridge, via dllhost.exe).

I'd suggest to log to a file and see what's happening there.

  • I've tried w3wp.exe and still nothing. I'll try the log file route temporarily to see what's going on. – Ryan Durkin Aug 14 '13 at 15:30
  • 1
    Most publish events get triggered through the service host IIRC. Did you try attaching to that? The rule is quite simple: if your handler breakpoint only sometimes triggers, you are not yet attaching to all relevant processes. – Frank van Puffelen Aug 15 '13 at 0:58
  • The log file code showed that the event is getting fired. Just need to figure out which process to attach to as debugging through a log file is not nice at all. Shall I change this question or close this question and start a new one about the correct process to attach to? – Ryan Durkin Aug 15 '13 at 8:54
  • Well, it has to be one of the three: w3wp, tcmservicehost or dllhost. Attach to all of them :) – Nuno Linhares Aug 15 '13 at 12:04
  • @RyanDurkin I think this question is fine, as people are likely to have the same problem in the same way. Once you figure out the process you could edit your question with the details and/or post your own answer. – Rob Stevenson-Leggett Aug 15 '13 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.