一.环境:SharePoint 2016 + Visual Studio 2015,

二.错误描述:

错误1:帮朋友写个计时器Demo,部署位置GAC,来回部署几次后,vs2015报错:

严重性 代码 说明 项目 文件 行 禁止显示状态
错误 Error occurred in deployment step 'Retract Solution': SP_CustomTimerJob.ListTimerJob 无法反序列化,因为它没有公共的默认构造函数。

错误2:打开管理中心—监控—复查作业,也报错:

SP_CustomTimerJob.ListTimerJob 无法反序列化,因为它没有公共的默认构造函数。

错误3:重新运行配置向导,继续报错:

System.MissingMethodException: SP_CustomTimerJob.ListTimerJob cannot be deserialized because it does not have a public default constructor

其他错误:使用各种命令卸载wsp或者删除TimerJob,都会报上面的错误。整个状态就是卸不掉,删不掉。

三.解决步骤:

首先,当vs报错时,我着魔似的顺手把对应的Feature用PowerShell给删除了,导致通过正常途径(包括命令)再也删不掉wsp了(这个坑害的我用了几乎一天才爬上来)。

教训就是,不要手动删除wsp包中的feature,要通过卸载wsp包的方式来移除feature。

报错的原因是继承SPJobDefinition的类里,没有提供默认的构造函数。类似如下:

解决办法,修改继承的SPJobDefinition类,添加需要的构造函数。然后用vs重新生成一下(用vs部署会失败)。

下面就是用gacutil.exe工具,把项目的dll注册到GAC里。这是最关键的一步。完成后,会发现管理中心的"复查作业"可以进去了。

剩下的就是用命令强制移除原来的wsp包,然后重新添加,然后重新强制安装wsp包。

参考:

https://bernado-nguyen-hoan.com/2010/06/03/cant-retract-sharepoint-timer-job-because-the-job-cannot-be-deserialized-because-it-does-not-have-a-public-default-constructor/

https://sharepoint.stackexchange.com/questions/193490/solution-cannot-be-deserialized-because-it-does-not-have-a-public-default-constr

Error occurred in deployment step 'Retract Solution': xxx 无法反序列化,因为它没有公共的默认构造函数的更多相关文章

  1. Error occurred in deployment step 'Add Solution': Operation is not valid due to the current state of the object.

    Sharepoint 部署的时候出现一个错误 Error occurred in deployment step 'Add Solution': Operation is not valid due ...

  2. SharePoint Error occurred in deployment step 'Recycle IIS Application Pool': 0x80070005:拒绝访问

    错误出现的前提:多个用户在一台机器上做开发,使用非系统管理员账号时会出现,因为一般创建网站集时指定管理员为系统管理员: 使用 Visual Studio 2010 部署时报错:Error occurr ...

  3. eclipse - An internal error occurred during: "Running Android Lint"

    概述 也不晓得为什么,编译eclipse,设置打开,就自动报错: An internal error occurred during: "Running Android Lint" ...

  4. 学习jvm,关于MAT an internal error occurred during:"Parsing heap dump" from问题

    写了一个死循环不断的创建对象,模拟内存溢出 package com.zuo.test1; import java.util.ArrayList; import java.util.List; publ ...

  5. An internal error occurred during: "Launching xxx on WebLogic10.x".

    An internal error occurred during: "Launching xxx on WebLogic10.x". java.lang.NullPointerE ...

  6. Dynamics CRM 2011 2013-(An error occurred while opening mailbox xxx@xx.com Microsoft.Crm.Tools.Email.Providers.)

    An error occurred while opening mailbox  Microsoft.Crm.Tools.Email.Providers. Whenever I check how C ...

  7. idea报错:[2016-08-31 09:20:10,763] Artifact xxx:war exploded: Error during artifact deployment.

    [2016-08-31 09:20:10,763] Artifact newClassProject1:war exploded: Error during artifact deployment. ...

  8. [DeploymentService:290066]Error occurred while downloading files from admin server for deployment request "0". Underlying error is: "null"

    weblogic 莫名无法启动: <Apr , :: PM CST> <Error> <Deployer> <BEA-> <Failed to i ...

  9. Mysql Solution - Timeout error occurred trying to stop MySQL Daemon. Stopping MySQL: [FAILED] -

    错误例如以下: Timeout error occurred trying to stop MySQL Daemon. Stopping mysqld:                         ...

随机推荐

  1. 15. 迭代器模式(Iterator Pattern)

    动机(Motivate):     在软件构建过程中,集合对象内部结构常常变化各异.但对于这些集合对象,我们希望在不暴露其内部结构的同时,可以让外部客户代码透明地访问其中包含的元素;同时这种“透明遍历 ...

  2. IIS 为应用程序池提供服务的进程在与 Windows Process Activation Service 通信时出现严重错误的解决方法

    系统环境:Windows Server 2008 R2 64位, IIS 7.0 错误信息: 为应用程序池提供服务的进程在与 Windows Process Activation Service 通信 ...

  3. 404.17 - 动态内容通过通配符 MIME 映射映射到静态文件处理程序

    刚刚重装了系统,原有的ASP.NET工程下面的WebService无法运行,如下: 404.17 - 动态内容通过通配符 MIME 映射映射到静态文件处理程序 微软的提示,是做三项更改,但是我改了之后 ...

  4. daemon_init函数:调用该函数把普通进程转变为守护进程

    #include <unistd.h> #include <syslog.h> #include <fcntl.h> #include <signal.h&g ...

  5. Spring整合redis配置文件详解

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  6. [译]使用mediatR的notification来扩展的的应用

    原文 你不希望在controller里面出现任何领域知识 开发者经常有这样的疑问"这个代码应该放在哪呢?"应该使用仓储还是query类?.... 怎么去实现职责分离和单一职责呢? ...

  7. 20155324 2016-2017-2 《Java程序设计》第6周学习总结

    20155324 2016-2017-2 <Java程序设计>第6周学习总结 教材学习内容总结 InputStream与OutputStream 串流设计 1.串流:Java将输入/输出抽 ...

  8. 20155324 2016-2017-2 《Java程序设计》第3周学习总结

    20155324 2016-2017-2 <Java程序设计>第3周学习总结 教材学习内容总结 定义类 要产生对象必须先定义类,类是对象的设计图,对象是类的实例.类定义时使用class关键 ...

  9. 小程序前端防止重复点击请求api的简陋方法

    upload: function () { let that = this; let {uploadFlag} = that.data; if (that.data.uploadFlag) { ret ...

  10. luogu P3244 [HNOI2015]落忆枫音

    传送门 md这题和矩阵树定理没半毛钱关系qwq 首先先不考虑有环,一个\(DAG\)个外向树个数为\(\prod_{i=2}^{n}idg_i(\)就是\(indegree_i)\),因为外向树每个点 ...