1

As far as I have worked with them, event receivers come with a properties object through which you could directly get the SPWeb and SPList objects.

However, if I used CSOM instead and implemented my logic through it, instead of SSOM, would it provide ANY reasonable improvements in server performance?

In general, would it be sensible to use CSOM with event receivers?

  • You mean to write CSOM in Farm solution Event Receivers, or to convert your Event Receivers to "Remote event receivers"? – Robert Lindgren Mar 7 '16 at 13:27
  • The first one. But since you ask, can I write remote event receiver without apps setup? – Nisarg Mar 7 '16 at 13:28
  • The first one is not a real path to take, if you ever get it to work it would only give you a lot of headache with no real profit. For remote event receivers (where you should be using CSOM) you would need the app infrastructure in place – Robert Lindgren Mar 7 '16 at 13:29
  • CSOM in event receiver???? No. I think is not good practice and no good performance... Why are you trying to do that? – Juan Pablo Pussacq Laborde Mar 7 '16 at 14:50
  • I am not trying that, no. I am evaluating the option. It seems quite counterintuitive (as Robert as highlighted in his answer already), but I still intend to consider all advantages and disadvantages. I have 12 hours to make a decision, and I intend to research well before that. – Nisarg Mar 7 '16 at 14:54
2

You mean to write CSOM in Farm solution Event Receivers, or to convert your Event Receivers to "Remote event receivers"?

The first one is not a real path to take, if you ever get it to work it would only give you a lot of headache with no real profit. The event receivers themselves require a farm solution, so you should use SSOM code in them.

For remote event receivers (where you should be using CSOM) you would need the app infrastructure in place, and the API is not as wide as for the SSOM event receivers, but it might be a path worth exploring if you want to be future proof and cloud ready

  • Hey, I appreciate your answer, but Apps are not setup with my environment and might not be in next 6 months. What I expect to know is, a) if someone has attempted to do something like this, or b) if someone knows enough of SSOM and CSOM to say if any reasonable performance or memory improvements can be expected. – Nisarg Mar 7 '16 at 13:47
  • 2
    I know enough of them both. No you will not have any improvements in performance by using CSOM over SSOM, more the opposite! Also, when writing code on the server side (farm solution code behind) the only valid approach is to use SSOM, you will have a hugh struggle getting CSOM to work in this scenario and also you would have to do strange things to be able to authenticate and get the right permissions in the event receiver. CSOM is designed to be run outside of the servers, not in server side solutions – Robert Lindgren Mar 7 '16 at 13:51

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.