views:

110

answers:

1

Possibly a silly question, but I'm having no luck finding an answer.

Using Visual Studio 2010 Beta 2, I have a SharePoint 2010 project with a feature defined, with that feature having an event receiver attached to fire some custom code. I'm now trying to remove the event receiver from the feature. I've deleted the event receiver code from the project, but the feature.xml Visual Studio is generating is still including the ReceiverClass attribute in the Feature node. Since the referenced class no longer exists, this obviously is a problem.

I can't find a way to remove this association in the UI without editing the feature manifest by hand, which I don't really want to do, because I still want Visual Studio to automatically fill out the rest of the manifest.

Is there a property of the feature somewhere I'm missing in the UI that will allow me to remove the association of the event receiver to the feature?

+1  A: 

A somewhat silly workaround I've found is to add a new event receiver to the feature, with no method definitions. This causes Visual Studio to write the feature.xml with a reference to the new class, effectively causing no custom code to run on feature activation, but forcing an empty class into your application and, worse yet, if this is the only code item in the solution, a superfluous DLL to be generated by your build.

OedipusPrime