I have created a simple list event receiver with item adding,updating,and deleting events in SharePoint 2013. But some how it is giving me a strange build error when i try to deploy the event receiver. Following is the error which i get

Add User to Department Contacts.exe' does not contain a static 'Main' method suitable for an entry point

Here Add User to Department Contacts is the name of my project.

Has anybody encountered this error? If yes how to overcome it?

Thanks in advance...


make sure you have compile set on the file properties.


single click "Feature1.EventReciver.cs" within solution explorer. Now look at the properties tab and you should see build action.... make sure its set to compile.

same goes for anything else within the project

| improve this answer | |
  • your solutions solved that problem but now it is giving another build error "Error:A namespace cannot directly contain members such as fields or methods 1 " – luckydeveloper Apr 9 '14 at 11:13
  • This is strange it is just a simple event receiver – luckydeveloper Apr 9 '14 at 11:18
  • I deleted the event receiver and created a new one and now its working. But i still don't know what was the issue. Thanks for your help – luckydeveloper Apr 9 '14 at 11:52
  • that is simple, you were adding in code directly stackoverflow.com/questions/21175781/… – Ali Jafer Apr 9 '14 at 12:13
  • the entire class and namespace code was generated automatically when i selected event receiver template in visual studio. and i had not written a single word by my self and just deployed it. But i got that message. – luckydeveloper Apr 9 '14 at 12:28

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.