Monday, March 12, 2012

Debugging Email enabled list functionality

Hi Folks,

Sure you will be running out of your gas while searching whats happening to your debugging session, while receiving the emails to your Email enabled list instance (Ex: Announcement list). Do you have face below scenario ->

1.You create a Email enabled list instance
2.Create a event receiver to process incomming email objects.
3.Attach Debugger process or enter System.Diagnostics.Debugger.Break() above your lines
4.Rebuild and Deploy the solution (did a IISRESET )
5.List instance appearing and you have configured email address
6.Send sample email.
7.Email delivered to Drop folder, after sometime email object just vanished but debugger session not started.

If this is the case, no worries :). Just restart the Sharepoint timer job service through services. If you having VS 2010 installed there is a cryptographic exception related session try to start, just cancel it and restart the service again. Then after try to send a sample email to the list instance, you will get the debugging session and VS direct you to the EmailReceived() method or any other method