How to upgrade workflow assembly in MOSS 2007
This problem generally start when you are having an existing custom workflow and there are instances of workflow running. You do some changes to the workflow and reinstall the assembly in the GAC. The new assembly is basically overwriting the existing one (it has same signature). When you try to complete the existing workflow instances after updating the assembly, you may get "Task is locked by running workflow instance" error or it just hangs in "In Progress" state.
So what did happen in background?
The public interface of the workflow, which has been serialized in the database, have changed and now the new assembly does not know how to de-serialize the workflow data from the database. At this point the workflow will fail as it is unable to serialize the current state and looks like it hanged in "In Progress" state.
Then how should I upgrade the assembly for a workflow?     
    
Upgrading running instances of a workflow is a tricky business because the workflow doesn't know, if it's current state is, before or after a change in the assembly. When anything changes in public interface of workflow assembly, serialization/de-serialization of workflow data fails. The new assembly of workflow does not know how to load the older serialized data.
If you are just changing the code logic within the methods, you should be able to update the workflow assembly without breaking the existing workflow instances. But if you add/remove/modify any activity or add/remove any properties/methods from the code and update the existing workflow assembly, that would break the existing instances.
In nutshell, any kind of changes to the interface (public code interface or workflow design interface, which is serialized) will break the workflow.
The suggested way to upgrade the workflow is to create a new version of workflow and install it in GAC and SharePoint. Mark the existing workflow to "No New Instance", which will not create any new instances of old workflow.   
Use the new workflow assembly for new instances, and the old workflow assembly for old instances. To do this, you need to update the assembly version to the next one (e.g. 2.0 from 1.0) and adjust the workflow.xml file to point to 2.0, then keep both 1.0 and 2.0 in the GAC. When you reinstall, new instances will use that new version, and old instances will continue to use the old and when all the older workflow instances have finished, you can remove the 1.0 version from the server.
How to upgrade workflow assembly in MOSS 2007的更多相关文章
- Custom Web Servic In MOSS 2007
		Tools: Visual Studio 2008,Visual Studio 2008 Command Prompt, Sharepoint Server 2007 Generate .disco ... 
- Create and Install Timer Job in MOSS 2007
		Excute Timerjob public class TriggerLoadCacheTimerJob : SPJobDefinition { string ExceptionFlag = str ... 
- MOSS 2007 错误0x80040E14解决
		今天公司内网莫名的出现错误,只能新建列表条目,不能创建网站,到后来列表条目也不能创建了,一直报0x80040E14错误.于是Google一把,搜索这个错误号,然后在apearce 的Blog找到了原因 ... 
- Upgrade custom workflow in SharePoint
		Experience comes when you give a try or do something, I worked in to many SharePoint development pro ... 
- sharepoint mysite and upgrade topics
		My Sites overview (SharePoint Server 2010)http://technet.microsoft.com/en-us/library/ff382643(v=offi ... 
- SharePoint 2007 页面定制(一)
		转:http://www.nanmu.net/SharePoint-MOSS-WSS-Silverlight/Lists/Posts/Post.aspx?ID=74 本文主要包括以下几方面内容: 1. ... 
- Windows SharePoint Services 3.0编码开发工具和技巧(Part 1 of 2)
		转:http://blog.csdn.net/mattwin/article/details/2074984 WSSv3 Technical Articles_Windows SharePoint S ... 
- 我大中华微软MVP中国区人才库
		刘海峰:国内知名微软开源技术网站51Aspx 创始人,十年以上的Asp.net从业经验,微软MSDN特约讲师.Teched讲师.ImagineCup大赛评委.人大出版社研修班特约讲师,曾多次受邀访问美 ... 
- Sharepoint学习笔记—习题系列--70-576习题解析 -(Q141-Q143)
		Question 141 You are planning an upgrade to a SharePoint 2010 application. You have the following r ... 
随机推荐
- 顺序图(Sequence Diagram)
			顺序图(Sequence Diagram)对系统的动态方面来建模. 顺序图是强调消息时间顺序的交互图. 协作图则是强调接收和发送消息的对象的结构组织的交互图 如何对动态方面建模?  所谓动态文面,即 ... 
- Unit Of Work--工作单元(一)
			简介 最近忙着新项目的架构,已经有一段时间没有更新博客了,一直考虑着要写些什么,直到有一天跟朋友谈起他们公司开发数据层遇到的一些问题时,我想应该分享一些项目中使用的数据访问模式. 虽然最近一直都在使用 ... 
- 【转】Linux下svn常用指令
			转自: http://blog.csdn.net/myarrow/article/details/8110858 1.将文件checkout到本地目录svn checkout path(path是服务 ... 
- Vim 插件之 NERDTree
			设置快键键 编辑 .vimrc 添加以下内容后,可以使用 ctrl + n 来开关 NERDTree 插件. map <silent> <C-n> :NERDTreeToggl ... 
- vmware workstation11+centos7+lnmp一键安装包 环境搭建
			vmware workstation11 1.下载:http://pan.baidu.com/s/1gecipOJ 2.安装:直接下一步. centos7 1.下载:网易镜像 http://mirro ... 
- Unity 全面理解加载和内存管理
			最近一直在和这些内容纠缠,把心得和大家共享一下: Unity里有两种动态加载机制:一是Resources.Load,一是通过AssetBundle,其实两者本质上我理解没有什么区别.Resources ... 
- Git 分支合并
			理解核心 Git最初只有一个分支,所有后续分支都是直接或间接的从这个分支切出来的. 在任意两个分支上,向前追溯提交记录,都能找到一个最近的提交同时属于这两个分支,这个提交就是两个分支的分叉节点 分支合 ... 
- 剑指架构师系列-Struts2构造函数的循环依赖注入
			Struts2可以完成构造函数的循环依赖注入,来看看Struts2的大师们是怎么做到的吧! 首先定义IBlood与BloodImpl类: public interface IBlood { } pub ... 
- .NET 产品版权保护方案 (.NET源码加密保护) (转载)
			说 明:你希望自己用.net辛辛苦苦做出来的软件被人轻易破解吗?你希望自己花了大量人力物力用.net开发出来的产品被竞争对手轻易获取核心代码吗?这是 一篇比较详尽地介绍如何保护自己的.net源代码的文 ... 
- sql server 随机读取数据
			--sql server 随机读取数据 * FROM [tablename] ORDER BY NEWID() pk from [tablename] ORDER BY NEWID()) --这两个方 ... 
