Error occurred in deployment step 'Retract Solution': xxx 无法反序列化,因为它没有公共的默认构造函数
一.环境: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包。

参考:
Error occurred in deployment step 'Retract Solution': xxx 无法反序列化,因为它没有公共的默认构造函数的更多相关文章
- 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 ...
- SharePoint Error occurred in deployment step 'Recycle IIS Application Pool': 0x80070005:拒绝访问
错误出现的前提:多个用户在一台机器上做开发,使用非系统管理员账号时会出现,因为一般创建网站集时指定管理员为系统管理员: 使用 Visual Studio 2010 部署时报错:Error occurr ...
- eclipse - An internal error occurred during: "Running Android Lint"
概述 也不晓得为什么,编译eclipse,设置打开,就自动报错: An internal error occurred during: "Running Android Lint" ...
- 学习jvm,关于MAT an internal error occurred during:"Parsing heap dump" from问题
写了一个死循环不断的创建对象,模拟内存溢出 package com.zuo.test1; import java.util.ArrayList; import java.util.List; publ ...
- An internal error occurred during: "Launching xxx on WebLogic10.x".
An internal error occurred during: "Launching xxx on WebLogic10.x". java.lang.NullPointerE ...
- 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 ...
- 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. ...
- [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 ...
- Mysql Solution - Timeout error occurred trying to stop MySQL Daemon. Stopping MySQL: [FAILED] -
错误例如以下: Timeout error occurred trying to stop MySQL Daemon. Stopping mysqld: ...
随机推荐
- python 包和模块间的引入
##############################总结####################### 主要内容: 1. 模块 2. import 3. from xxx import xxx ...
- jest-babel报错:Requires Babel "^7.0.0-0", but was loaded with "6.26.3"
解决方法: yarn remove jest babel-jest babel-core @babel/core yarn add --dev jest babel-jest babel-core@^ ...
- ruby----%使用法
%{String} 用于创建一个使用双引号括起来的字符串,这个表示法与%Q{String}完全一样 result = %{hello} puts "result is: #{result} ...
- Linux 内核里的数据结构:红黑树(rb-tree)
转自:https://www.cnblogs.com/slgkaifa/p/6780299.html 作为一种数据结构.红黑树可谓不算朴素.由于各种宣传让它过于神奇,网上搜罗了一大堆的关于红黑树的文章 ...
- HDU - 6394 Tree(树分块+倍增)
http://acm.hdu.edu.cn/showproblem.php?pid=6394 题意 给出一棵树,然后每个节点有一个权值,代表这个点可以往上面跳多远,问最少需要多少次可以跳出这颗树 分析 ...
- HDU - 5073 Galaxy(数学)
题目 题意:n个点,运行移动k个点到任何位置,允许多个点在同一位置上.求移动k个点后,所有点到整体中心的距离的平方和最小. 分析:这题题目真的有点迷...一开始看不懂.得知最后是选取一个中心,于是看出 ...
- ACdream - 1060 递推数(矩阵+循环节)
https://vjudge.net/problem/71677/origin 已知A(0) = 0 , A(1) = 1 , A(n) = 3 * A(n-1) + A(n-2) (n ≥ 2) 求 ...
- 细说shiro之六:session管理
官网:https://shiro.apache.org/ 我们先来看一下shiro中关于Session和Session Manager的类图. 如上图所示,shiro自己定义了一个新的Session接 ...
- 验证调用HttpServletResponse.getWriter().close()方法是否真的会关闭http连接
起因 线上项目突然遭到大量的非法参数攻击,由于历史问题,之前的代码从未对请求参数进行校验. 导致大量请求落到了数据访问层,给应用服务器和数据库都带来了很大压力. 针对这个问题,只能对请求真正到Cont ...
- Docker 操作记录
Docker docker info 查看信息 docker 更改镜像目录 方式:1.配置文件修改 # cat /etc/sysconfig/docker |grep -v ^# |grep -v ^ ...