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: ...
随机推荐
- Docker记录-Docker部署记录
1.Docker介绍 Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从Apache2.0协议开源. Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后 ...
- JAVA-try-catch-finally-自定义异常例子(适合初学者)
package com.net.xinfang.reflect; import java.io.IOException; import java.util.Scanner; /*** * 运行try块 ...
- css 动画【转】
css 动画 http://www.w3school.com.cn/css3/css3_animation.asp
- 【leetcode-71】 简化路径
(1 pass) 以 Unix 风格给出一个文件的绝对路径,你需要简化它.或者换句话说,将其转换为规范路径. 在 Unix 风格的文件系统中,一个点(.)表示当前目录本身:此外,两个点 (..) 表示 ...
- ACM-ICPC 2018 南京赛区网络预赛 J Sum (思维+打表)
https://nanti.jisuanke.com/t/30999 题意 f(i)表示i能拆分成两个数的乘积,且要求这两个数中各自都没有出现超过1次的质因子的方案数.每次给出n,求∑(n,i=1)f ...
- HDU 1021(斐波那契数与因子3 **)
题意是说在给定的一种满足每一项等于前两项之和的数列中,判断第 n 项的数字是否为 3 的倍数. 斐波那契数在到第四十多位的时候就会超出 int 存储范围,但是题目问的是是否为 3 的倍数,也就是模 3 ...
- POJ 3070(求斐波那契数 矩阵快速幂)
题意就是求第 n 个斐波那契数. 由于时间和内存限制,显然不能直接暴力解或者打表,想到用矩阵快速幂的做法. 代码如下: #include <cstdio> using namespace ...
- C++使用libcurl
1.下载地址https://curl.haxx.se/download.html 2.选择zip压缩包下载 3.选择合适自己的vc版本 4.启动项目选择libcurl 5.因为暂时不需要ssh2,预处 ...
- H5网页适配 iPhoneX,就是这么简单
iPhoneX 取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题.对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可( ...
- luogu 2371 墨墨的等式
1.背包dp #include<bits/stdc++.h> #define rep(i,x,y) for(register int i=x;i<=y;i++) #define ll ...