How to associate Event Receiver with Library Using Sandboxed Solution?

Unanswered How to associate Event Receiver with Library Using Sandboxed Solution?

  • Monday, February 08, 2010 1:20 PM
     
     
    Hi,

    I created a sandboxed solution with one event receiver.  When trying to add the 'wire-up' code to the Feature's OnActivated event, I noticed that I don't have the ability to call the .Add method on my target library's EventReceiver collection. 

    How do I associate my event receiver with my document library using a sandboxed solution?  Thank you for your help.

    Steven

All Replies

  • Monday, February 15, 2010 9:24 PM
     
     
    If .Add is not showing up, I am guessing this is not an allowed operation inside a Sandboxed solution.  Although I would think this operation would be allowed.  If you switch to farm solution and .Add works, then that is definitely the case.
    Corey Roth blog: www.dotnetmafia.com twitter: @coreyroth
  • Tuesday, February 16, 2010 9:20 AM
     
     
    Did you try using the EventReceiver Item Template or Project Template, because that works pretty well in Sandboxed solutions. Event Receivers are supported in Sandboxed solutions.

    Regards,
    Chakkaradeep || SharePoint Developer - MCTS SharePoint Dev, WSS Dev
    http://www.intergen.co.nz || Twitter: http://twitter.com/chakkaradeep || http://www.chakkaradeep.com