0

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]. 
  • If I understand correctly, you wrote this timer job. Could you debug it in VS? Deploy timer job, reset OWSTIMER (in PowerShell you do it by -> net stop sptimerv4 / net start sptimerv4), attach to OWSTIMER process (in VS) and then in Central Administration run timer job. You should see which part of code is problematic in Visual Studio. – StupidOne Nov 20 '13 at 17:15
  • I retracted the timer job and able to see the ServiceJOBDefination.aspx page . – Nikhil J Nov 20 '13 at 17:22
  • Again i tried to deploy the Timer job i am getting below error – Nikhil J Nov 20 '13 at 17:23
  • I deployed the solution using the Powershell Command instead of Visual Studio and the timer job is working as expected.Not sure why is it behaving in this fashion. – Nikhil J Nov 20 '13 at 18:30
0

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
  • If this is your answer, please marked it as the accepted solution. This way the question will have a correct state (resolved) :) – Robert Lindgren Jan 9 '14 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.