5

I have an Event handler on Component's save event on which I've subscribed as follows:

EventSystem.Subscribe<Component, SaveEventArgs>(OnComponentPreSave, EventPhases.Initiated);

When I change Component and press "Save" button on the content manager, event handler fires just fine. When I call ICoreService.Save method over Component on my custom page, Component is saved but the event handler does not fire.

Can someone explain why is this happening? Thanks in advance

  • 1
    Can you confirm that you are changing something in the component through the core service code and then calling the Save method through your code – Pankaj Gaur Feb 17 '15 at 7:04
3

What CoreService binding are you using? UI is talking to windows service TCM Service Host, however you may choose either windows service or IIS based core service. In order for event system to be initialized you need to restart the hosting process (either windows service or IIS reset). It seems to me that you have restarted only TCM Service host, thus CME is working fine, but connecting to IIS based core service which was not restarted and knows nothing about your event system.

  • Thanks a lot! I restarted IIS with iisreset command and I've got "Assembly not found" exception. Solution was to copy assemblies required to Tridion_home\webservices\bin from Tridion_home\bin folder. – 1g0r Feb 17 '15 at 12:30
  • I think what you did is wrong. You shouldn't have relative path to dll, it should be absolute. As it is now you should have 2 copies of dll in order to make all work. And you may accept my answer, btw – Andrey Marchuk Feb 17 '15 at 12:41
1

You may using this link to first time deploy and further update to Event System dll. I did same and worked perfectly. You should not deploy dll twice at two different locations.

The only thing you may need to keep config file also in bin folder.

0

To GAC one can place only Strong-Named Assemblies. That's not my case. Thanks to user978511 I discovered what was the problem. Now i've changed binding to communicate TCM Service host directly. So there's no need to duplicate assembles.

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.