SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
$web = Get-SPWeb "http://----/PWA/Test Project/"
$list = $web.Lists["Risks"]

This shows 3 events; ItemAdded, ItemDeleted, ItemUpdated. Below is an example of one of them to show its there.

Id                          : xxxxx-96a1-4e1c-acbd-c98cd8d16e19
Name                        : ItemAddedEventReceiver
SiteId                      : xxxxx-a858-443f-8159-6a6e33758693
WebId                       : xxxx-f09b-4f3a-be28-1d5f6a158ac1
HostId                      : xxxxx-1d5a-4e5c-8fa9-d3615d33b315
HostType                    : List
ParentHostId                : 00000000-0000-0000-0000-000000000000
ParentHostType              : Site
Synchronization             : Asynchronous
Type                        : ItemAdded
SequenceNumber              : 4000
Assembly                    : Microsoft.Office.Project.Server.PWA,Version=14.0.
Class                       : Microsoft.Office.Project.PWA.WSSEventReceivers.PS
Data                        :
Filter                      :
Credential                  : 0
ContextItemId               : 0
ContextItemUrl              :
ContextType                 : 00000000-0000-0000-0000-000000000000
ContextEventType            : 00000000-0000-0000-0000-000000000000
ContextId                   : 00000000-0000-0000-0000-000000000000
ContextObjectId             : 00000000-0000-0000-0000-000000000000
ContextCollectionId         : 00000000-0000-0000-0000-000000000000
UpgradedPersistedProperties :

If I run in debug mode the breakpoint never hits (I turned off auto activate, set breakpoints, deployed, activated feature, tried adding and then deleting).

   public override void ItemAdded(SPItemEventProperties properties)
       MailMessage mailMessage = new MailMessage();
       mailMessage.Bcc.Add(new MailAddress(""));
       mailMessage.From = new MailAddress("");
       mailMessage.Subject = "Boom Risk";
       mailMessage.Body = "test body";

       var smtpClient = new SmtpClient
           Host = "",
           Port = 25,
           Credentials = new NetworkCredential
               ("", "")



That is the code.

Can anyone suggest why it may not be working?


share|improve this question
Just to double-check -Is the ItemAdded method you posted within the Microsoft.Office.Project.PWA.WSSEventReceivers.PS DBUpdater class? – Ted N. Nov 2 '12 at 17:36
Hmm. I created it through VS2010 as a SharePoint thing. It is in the class: public class EventReceiver : SPItemEventReceiver { etc. } – Oliver Nov 5 '12 at 9:06
up vote 0 down vote accepted

Well after all that....

As I am on Project Server I had been deploying to the PWA. Turns out I have to deploy to every individual Project Site. Once I deployed to one of these it worked!


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.