一.环境: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. MyBatis-DynamicSQL 动态SQL

    MyBatis 的动态 SQL 使用 OGNL 表达式 http://commons.apache.org/proper/commons-ognl/language-guide.html 在 XML ...

  2. Understanding Favicon

    Favicon 简介 Favicon : 是favorites icon 的缩写,被称为website icon . page icon. urlicon. 最初定义一个favicon的方法是将一个名 ...

  3. golang json反序列化

    package main import ( "encoding/json" "fmt" "reflect" ) type js struct ...

  4. @GetMapping(value="/") , "/" 可加可不加 ,是不是一样的

    @GetMapping(value = "/user") 和  @GetMapping(value = "user") 的区别 1.带上 "/&quo ...

  5. HDU - 6357 Hills And Valleys(DP)

    http://acm.hdu.edu.cn/showproblem.php?pid=6357 题意 给一个数值范围为0-9的a数组,可以选择翻转一个区间,问非严格最长上升子序列,以及翻转的区间. 分析 ...

  6. 使用Calender类获取系统时间和时间和运算

    使用Calender类获取系统时间和时间和运算: @Test public void testCal(){ //使用Calender对象获取时间,并对时间进行计算: Calendar instance ...

  7. Tornado的异步非阻塞

    阻塞和非阻塞Web框架 只有Tornado和Node.js是异步非阻塞的,其他所有的web框架都是阻塞式的. Tornado阻塞和非阻塞两种模式都支持. 阻塞式: 代表:Django.Flask.To ...

  8. HTTP method constants

    HTTP method constants ngx.HTTP_GET ngx.HTTP_HEAD ngx.HTTP_PUT ngx.HTTP_POST ngx.HTTP_DELETE ngx.HTTP ...

  9. 【五】服务熔断、降级 —— Hystrix(豪猪)

    分布式系统面临的问题 复杂分布式体系结构中的应用程序有数十个依赖,每个依赖关系将在某些时候将不可避免地失败. 服务雪崩 多个微服务之间调用的时候,假设微服务A调用微服务B和微服务C,微服务 B和微服务 ...

  10. HACK入别人的游戏制作做MOD的几种技巧

    要让某个游戏(程序)加载我们的MOD,目前有想到的有三种方式: 静态注入:静态注入,即我们HACK入游戏的某个dll,然后修改里面的代码,让程序在运行后加载我们的ModDll,比如U3D的游戏可以直接 ...