I have an event receiver I developed with Visual Studio that I want to deploy. But in this case I want to deploy it without associating it with any list. (I add the event receiver to a specific list later via PowerShell.)
I know that if I set the Scope
to Site
then the receiver will fire for all lists and libraries. And I know that if I set the Scope
to Web
and provide a value for ListUrl
then it will only bind to the specified list.
However, it seems that if I set the Scope
to Web
and do not specify a ListUrl
, it acts the same as Site
and binds to everything. Here is my code
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers Scope="Web">
<Receiver>
<Name>AutoNumberDocumentItemAdded</Name>
<Type>ItemAdded</Type
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>ArticleManagementWorkflow.AutoNumberDocument.AutoNumberDocument</Class>
<SequenceNumber>10000</SequenceNumber>
<Synchronization>Synchronous</Synchronization>
</Receiver>
</Receivers>
</Elements>
Is there a way to deploy and activate the receiver without it being bound to anything?