You should use Feature Upgrading to register the new EventReceiver.
Just creating the code will not tell SharePoint to call the EventReceiver you have to do that in either an Elements.xml file using <Receivers>
element or through code by creating a new element in the right EventReceivers collection
For the following examples assume you're upgrading to verion 7.0.0.0.
CAML
To add the event receiver in CAML your feature.xml should be something like:
<?xml version="1.0" encoding="utf-8" ?>
<Feature ... Version="7.0.0.0">
<UpgradeActions>
<VersionRange BeginVersion="0.0.0.0" EndVersion="7.0.0.0">
<ApplyElementManifests>
<ElementManifest Location="MyNewEventReceiver\Elements.xml" />
</ApplyElementManifests>
</VersionRange>
<UpgradeActions>
...
<ElementManifest Location="MyNewEventReceiver\Elements.xml" />
</Feature>
With the new Elements.xml being applied both on upgrade and on new activations
Code
To add the event receiver in code your feature.xml should be something like:
<?xml version="1.0" encoding="utf-8" ?>
<Feature ... ReceiverAssembly="XXX" ReceiverClass="YYY" Version="7.0.0.0">
<UpgradeActions>
<VersionRange BeginVersion="0.0.0.0" EndVersion="7.0.0.0">
<CustomUpgradeAction Name="AddNewEventReceiver" />
</VersionRange>
<UpgradeActions>
...
</Feature>
And in the FeatureReceiver you'll have code like:
public override void FeatureUpgrading(SPFeatureReceiverProperties properties, string upgradeActionName, System.Collections.Generic.IDictionary<string, string> parameters)
{
SPWeb parentWeb = (SPWeb)properties.Feature.Parent;
switch (upgradeActionName)
{
case "AddNewEventReceiver":
// Add EventReceiver;
break;
...
}
}
public override virtual void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWeb parentWeb = (SPWeb)properties.Feature.Parent;
...
// Add EventReceiver;
...
}
public override virtual void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
SPWeb parentWeb = (SPWeb)properties.Feature.Parent;
...
// Remove EventReceiver;
...
}
With the code for adding the EventReceiver being run on Upgrade with ActionName = "AddNewEventReceiver" as well as on new activations. And of course removing it on deactivation.
To add an eventReceiver in code use something like:
parentWeb.Lists[_listName].EventReceivers.Add(_eventType, Assembly.GetExecutingAssembly().FullName, _eventReceiverClassName);