中央管理员:作业定义(_admin / servicejobdefinitions.aspx)页面抛出对象引用错误。一切正常工作3-4天后,我试图检查我的自定时定时器作业是否正常工作,但我得到上述错误。缩回了自定义定时器作业,我能够看到定时器作业。但是当我尝试激活该功能时,我得到以下错误:

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]. 
.

有帮助吗?

解决方案

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
许可以下: CC-BY-SA归因
scroll top