So the answer is yes, timer jobs do need a default constructor, even if there isn't a need to have one. When my colleague tried to deploy an update to a timer job after pulling out the constructor, he got the following message:
Uninstall-SPSolution: MyCo.MyTimerJob.JobDefinition cannot be deserialized because it does not have a public default constructor
Tried to uninstall through the SharePoint UI but had the same error.
The fix was to put the constructor back in the code, then take the DLL and GAC it onto the server. Use PowerShell for this or if you have permissions drop it into the c:\windows\assembly folder, then perform an IISReset for good measure. After that you can uninstall the solution and redeploy.
4 comments:
Had this exact issue. Thanks for the fix!
Thanks a lot! Resolved my issue.
Thank you, exactly what helped.
Great, thx! But you should restart SharePoint Timer Service.
Post a Comment