I cant seem to figure out what the issue is while I try to deploy my event receiver targeted at a particular list on my site.

All I am trying to do in the event receiver is to check (on itemUpdating) if property of a department field in a list item changes pop an alert.

I have checked out the following links but none of the solutions seem to fit my situation.

Error occurred in deployment step 'Activate Features': <nativehr>0x80070002</nativehr><nativestack></nativestack>



Here is the code I have:

 namespace EmployeeTransferVS1.EmployeeTransferUpdating
/// <summary>
/// List Item Events
/// </summary>
public class EmployeeTransferUpdating : SPItemEventReceiver
    /// <summary>
    /// An item is being updated.
    /// </summary>
    ///string siteUrl = "";
    public override void ItemUpdating(SPItemEventProperties properties)
            if (properties.BeforeProperties["Department"] != properties.AfterProperties["Department"])
                Console.Write(@"<script language='javascript'>alert('Updated');</script>");
        catch (Exception ex)
            throw ex;

And here is the elements.xml file with my targeted ListURL

Please note that I have tested the url and the list access via my CAML builder and I am able to access and query just fine with the same account.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListUrl="EPD">

Any ideas/suggestions?


  • 1
    How u get Console.Write in event receiver class...?
    – Pushpendra
    Commented Sep 21, 2013 at 6:37
  • @Pushpendra I am just trying to make sure it is firing right in the first place.
    – user7400
    Commented Sep 23, 2013 at 14:19

2 Answers 2


In your event receiver's Element.xml file,

In Place of the below code

<Receivers ListUrl="EPD">

Try with the follwoing code,

<Receivers ListUrl="Lists/EPD">


  1. ListUrl --> Specifies the URL of the list to which the event receiver applies to.
  • FYI: Its already been tried. I am able to deploy without the error when I just use the default list template line that was generated initially. THanks!
    – user7400
    Commented Sep 23, 2013 at 14:17

I know this is old, but so is Sharepoint. I recently had this issue and I have been in search of the solution for this problem. My issue was a little different, but easily overlooked. My List was present on a sub-site.

If this is the issue for you, simply change the the site URL to your sub-site to the correct one and it will deploy.

Here is an excerpt from the article that helped me.

This is easy to fix – you just need to alter the Site URL for your project. To do this, single-click on your project name in the Solution Explorer (not the main Solution node, but the one under it). In the Properties pane, find the Site URL property, which you’ll see is set to your top-level site URL. Simply add the remainder of the URL to point to your subsite...


I didn't even make it past the first bullet point and my issue was fixed. - Hope this helps someone out there.

  • Quote the main points from the article as links tend to go down. Commented Jan 5, 2017 at 16:06

Your Answer

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

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