Wednesday 25 June 2014

SharePoint 2010/2013: Enable-SPFeature Error (Failed to create receiver object from assembly)

So I had another lovely error recently, I had a wasp which had some external assemblies, I accidentally forgot to add one to the package manifest and when it deployed I got:

Enable-SPFeature : Failed to create receiver object from assembly "ASSEMBLYNAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=eaf1b7820cf1
fb30", class "CLASSNAME" for feature "FEATURENAME" (ID: 08284496-c68e-4f6c-befe-5777d14ad74b).
: System.ArgumentNullException: Value cannot be null.

So I instantly realised I was being silly and added the reference to the package manifest, packaged it, cabbed it, The Dll was in there, Great! I deployed the wsp and tried The deployment script again, it failed on the same point, I checked the gas, it was there alright, everything was looking as it should, but I couldn't activate the feature.

What was wrong? I tried deploying once more, did an observer for good measure and still nothing.

I then thought I would reopen the PowerShell window and try once again on the off chance that something was borked, so I restarted it, ran the script and it worked!

For some reason, the PowerShell session had cached the old error response from the feature activation, I don't know why but that's what it seemed to do.

Rule of thumb for the future, open a new ps session if you get an unexplained issue with a ps script

No comments:

Post a Comment