I am having SharePoint 2010 with 1 Application Server and 1 Front End Web Server I want to call a Web Service to send SMS (SOAP 1.2) whenever an item is added to a Custom List. I tested a Event Receiver in sandbox solution with basic change of title which worked but calling to a Web service failed in a Sandbox environment. so I decided to do a Farm Solution .. In the Farm Solution I am not able to get the basic Update Event Receiver functional the issues I ran and struggled with
- GACDepolyment
- WebApplication

Scope (tried both WEB as well as SITE) Used power shell commands

Currently I am stuck when I call SPEnbale command which throws an Activation Error that the Object is in Use ...

Can you please give me clear Steps on how can I write a List Item Event Receiver with the exact settings and deploying of the same.

1 Answer 1


This is from MSDN and I see no reason why this should not work:

To create the event handler

  1. Start Microsoft Visual Studio 2010.
  2. On the File menu, point to New, and then click Project.
  3. In Project Types, under Visual Basic or C#, select Event Receiver.
  4. Type DeletingEventReceiver as the project name. Click OK.
  5. In the SharePoint Customization Wizard, choose Deploy as a sandboxed solution. Click Next.
  6. In the Choose Event Receiver Settings dialog, select List Item Events in the What type of event receiver do you want? dropdown.
  7. In the What item should be the event source? dropdown, choose Tasks.
  8. Choose the An item is being deleted option in the Handle the following events list. Click Finish.
  9. In the EventReceiver1 file that is created, insert the following code in the ItemDeleting method.

    properties.Status = SPEventReceiverStatus.CancelWithError; properties.ErrorMessage = "Deleting items from " + properties.RelativeWebUrl + " is not supported.";

  10. Press F5 to deploy the solution.

  11. Navigate to a task list and select an item in the list. Click the Delete Item button on the Server ribbon.

  12. Observe the error message.

Source: http://msdn.microsoft.com/en-us/library/office/ms453149(v=office.14).aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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