We had earlier developed an event receiver for On Premise 2013 Sharepoint Site. Now the requirement is to migrate that event receiver to Sharepoint Office 365 as a Remote Event Receiver. After complete migration of code using (spsite = properties.Site) and web object is giving error

'Microsoft.SharePoint.Client.EventReceivers.SPRemoteEventProperties' does not contain a definition for 'web' and no extension method 'web' accepting a first argument of type 'Microsoft.SharePoint.Client.EventReceivers.SPRemoteEventProperties' could be found (are you missing a using directive or an assembly reference?)

Cant we use SP objects on Remote Event Receiver. if not what is a workaround?


You can use only client side API in remote receivers. Mainly below namespaces

using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.EventReceivers;

Then you can follow the pattern of first creating the context object and then loading followed by executeQuery.

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.