Contents
Can you add event receivers without app context?
Event receivers added to host web without app context, for example with SharePointOnlineCredentials or other means, will not return access token and you’ll have to access the host web with app-only access token Adding event receivers to the host web is supported. It is only possible to do this via CSOM/REST APIs, not by using Visual Studio wizards.
How are event receivers added to the host web?
Event receivers added to the host web will return access token, if they are applied from app context using app access token and operation in the host web is end user driven (ItemAdded etc.) AppInstalled event must complete within 30 seconds or SharePoint will think it has failed.
Is it possible to add event receivers to SharePoint?
Adding event receivers to the host web is supported. It is only possible to do this via CSOM/REST APIs, not by using Visual Studio wizards. SharePoint will absolutely call the event receiver end points configured for a given event.
How to debug event receivers in azure and Visual Studio?
To debug event receivers you need to configure a few different things in Azure and Visual Studio. The following article provide step by step instructions and more information related to debugging.
Why is my event receiver not receiving a context token?
If you do some debugging, you’ll find that the event receiver does NOT receive a valid context token from SharePoint/Office 365 – SPRemoteEventProperties.ContextToken is an empty string. This causes all the later code to fail.
Are there remote event receivers in Visual Studio?
Microsoft provided tooling with Visual Studio to create Remote Event Receivers, but unfortunately the only way to expose this tooling was in the context of a Provider-Hosted App. This is unfortunate because Remote Event Receivers have nothing to do with Provider-Hosted Apps.
Where are event receivers and list event receivers created?
In a typical Full Trust Code (FTC) / Farm Solution scenario, Event Receivers and List Event Receivers were created with the SharePoint Server Side Object Model code and deployed via Solutions. In this scenario, the event receiver code runs on the SharePoint server.