Question

The Central admin: Job definition (_admin/ServiceJobDefinitions.aspx) page throwing object reference error. Everything was working as expected 3-4 days back , i tried to check if my custom timer jobs are working as expected but i am getting the above error . Retracted the custom timer job , i am able to see the timer job .But when i try to activate the feature i get below error :

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase,  Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr  pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean  suppressSecurityChecks) 
  at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) 
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) 
at System.Reflection.Assembly.Load(String assemblyString) 
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject() 

WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value     [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value    [HKLM\Software\Microsoft\Fusion!EnableLog]. 
Was it helpful?

Solution

Below mentioned issue helped me to resolve the issue: Failed to load receiver assembly when activate feature

If the assembly contains any event or feature receivers then the deployment target should be Global Assembly Cache. And if you deploy the solution using a command line then you should start a new instance of that before activating the feature (this is most important when you get to upgrading) as an old version of the dll can't be unloaded.

Remove feature receiver
Clean solution
Close Visual Studio
Delete SharePoint project's obj folder in Windows Explorer
Delete SharePoint project's bin folder in Windows Explorer
Open Visual Studio and re-add feature receiver
Start Debugging
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top