Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot enable feature with feature receiver via PowerShell

I've got a problem where I can enable a feature the UI and everything works as expected through site settings, but if I try and enable the feature via the Sharepoint powershell (which we are doing as part of a scripted deployment), I get the following:

Enable-SPFeature : Failed to create receiver object from assembly "xxxxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=967e6960f5af91e6 ", class "xxxxx.EventReceiver" for feature "xxxxx.Public.Search" (ID: 026d7c45-a359-4550-822d-1a6c35e58e0 d).: System.ArgumentNullException: Value cannot be null. Parameter name: type

Does anyone know why this would occur, or some things I should check? The feature definition is definitely correct (since deploying it through the UI works as expected, and I've also double checked the PublicKeyToken is correct etc etc), and restarting the services and iisreset doesn't enable me to use Enable-SPFeature either.

like image 538
Henry C Avatar asked Sep 16 '10 03:09

Henry C


2 Answers

I have the same issue. The curious thing is when you open up a new SP2010 powershell window and reissue the same command the assembly is found without any problems. See: http://khurramdotnet.blogspot.com/2011/01/enable-spfeature-command-throwing.html

like image 180
Evert Avatar answered Oct 05 '22 21:10

Evert


Try this: go to the Control Panel, click on "Programs", click on "Programs and Features", select "Microsoft SharePoint Server 2010" (or whatever you have installed), click "Change", select "Repair" and click "Continue". This is what helped me.

like image 35
Sven Avatar answered Oct 05 '22 22:10

Sven