Monday 6 June 2011

Failed to create receiver object from assembly

I ran into a problem re-installing a WSP package which I'd added a feature receiver to, using powershell; it looked to have worked, but when I looked in Central Administration and looked at the solutions, it had installed with the following error:

ServerX : Failed to create receiver object from assembly "XXXX.YYYY.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=abcd1234efgh5678", class "XXXX.YYYY.WebParts.Features.Feature1.Feature1EventReceiver" for feature "WebParts_Feature1" (ID: 57cf6cbd-72e9-43a2-bf85-bb947587073f).: System.ArgumentNullException: Value cannot be null.
Parameter name: type
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
ServerX : Failed to create receiver object from assembly "XXXX.YYYY.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=abcd1234efgh5678", class "XXXX.YYYY.WebParts.Features.Feature1.Feature1EventReceiver" for feature "WebParts_Feature1" (ID: 57cf6cbd-72e9-43a2-bf85-bb947587073f).: System.ArgumentNullException: Value cannot be null.
Parameter name: type
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()


It turns out that the SharePoint Timer service which handles solution installation caches DLLs and it had cached the old DLL which had no feature receiver. A simple re-start on the service solved the problem.

Found solution here after much googling:

http://social.technet.microsoft.com/Forums/en/sharepoint2010setup/thread/55217486-0df5-43ca-9487-cdb7a66334c9

8 comments:

  1. Thanks bro! You saved my installation.

    ReplyDelete
  2. Thanks !!! It worked and saved me.

    ReplyDelete
  3. Thanks !!! It worked for me too :)

    ReplyDelete
  4. thanks! worked for me as well!

    ReplyDelete
  5. Thanks! This really helped.

    ReplyDelete
  6. This helped, thanks! For me I also needed an iisreset on the central admin page (if you chose to deploy through that)

    ReplyDelete