Avatar of BKennedy2008
BKennedy2008 asked on

SharePoint EventReceiver tying to a specific Document Library (Custom)

I want to take an event receiver and tie it to a specific Document Library that is created on about 10 out of 20 sites called "ApprovedDocuments". The eventReceiver works fine, however, when I modify the elements.xml from   <Receivers ListTemplateId="101"> to
<Receivers ListUrl="Lists/ApprovedDocuments"> from instructions on how to tie to a specific list, I get the follwing error when I deploy the testDB

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

Any ideas I can look for in this, or another way to tie a eventreceiver to a specific list?
Thanks
Microsoft SharePoint.NET Programming

Avatar of undefined
Last Comment
BKennedy2008

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rainer Jeschor

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
BKennedy2008

VS2010, I tried the first solution with no luck. I will work through the second solution.
Thanks
ASKER
BKennedy2008

Thanks again - Next time I will hire you as a consultant....

Just wrapping it with : If (properties.List.Title = "Approved Documents") Then

do something....


Thanks
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23