Can’t retract SharePoint timer job because the job "cannot be deserialized because it does not have a public default constructor"

If you forgot to include a default constructor in your timer job class, you will get the error below when activating the feature that installs the job:

SharePointProject1.TimerJobs.TrackingTimerJob cannot be deserialized because it does not have a public default constructor.

The problem is, if you were doing (and deploying) this through Visual Studio 2010, it will install and attempt to deploy the solution. During solution deployment however, feature activation will fail, but the solution will be marked as deployed anyway in SharePoint.

The problem is now you can’t retract/delete this solution from SP, because you will run into the error above.

To fix this, fix your timer class (i.e. include the default constructor), then un-GAC the assembly containing your timer job, then try retracting/deleting the solution and it will work.

Advertisements

About Bernado

Based in Australia, I am a freelance SharePoint and Dynamics CRM developer. I love developing innovative solutions that address business and everyday problems. Feel free to contact me if you think I can help you with your SharePoint or CRM implementation.
This entry was posted in SharePoint. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s