By default event receivers are asynchronous meaning that they run under the SharePoint timer service (OWSTIMER.exe). This means that the event receivers:
- Are not executed immediately, rather it is scheduled to be executed by OWSTIMER.exe.
- Don’t run under w3wp.exe process anymore, so when you want to debug your event receivers, you have to attach to OWSTIMER.EXE and wait till they are executed.
However, you can control this behavior using the Synchronization attribute:
If you set it to Synchronous, then the event receivers run immediately and under the w3wp.exe process. So, if your solution depends on event receivers highly and expect the results immediately, then you have to set it to Synchronous, else setting it to Asynchronous should do the job.
______________________________________________________________________________
1
| System.Diagnostics.Debugger.Launch(); |
Add it anywhere you want in your code, deploy your solution and begin testing. Before you can begin debugging, a popup window will appear providing you options where to debug your code, choose an option and begin to debug your code.
Some truly superb blog posts on this web site ,thank you for contribution.
ReplyDeletesharepoint administrator training
In SharePoint 2013 event receiver runs in only in w3wp.exe, it does not matter that the event is Synchronous or Asynchronous
ReplyDelete