.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Workflow Error ......System.Workflow.Runtime.Hosting.PersistenceException :Cannot access a disposed

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :WPF
I have a workflow that works fine on our development server...However on the production server it gives the exception below....

I have compared the configuration on both the servers and its the same.
I have hard to get around this error...

Can someone help please...

.WorkflowRuntimeService._workflowRuntime_WorkflowTerminated() Workflow ab37dd8b-c642-4a2a-9573-566e54a566cf Terminated: System.Workflow.Runtime.Hosting.PersistenceException: Cannot access a disposed object.
Object name: 'Transaction'. ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Transaction'.
  at System.Transactions.Transaction.Rollback(Exception e)
  at System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback)
  at System.Workflow.Runtime.Hosting.DefaultWorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback)

View Complete Post

More Related Resource Links

System.Workflow.Runtime.Hosting.PersistenceException Timeout expired.

Is there a way for me to set the CommandTimeout property on the SqlCommand. I can see that there is a DbResourceAllocator that has a NewCommand that creates the SqlCommand but there is now way that I can change the CommandTimeout property. My workflow is quite large and I am save the Tracking information as well with the SharedConnectionWorkflowCommitWorkBatchService. These are the service that I load: string connectionString = ConfigurationManager.ConnectionStrings["DBConnectionWorkflowTracking"].ConnectionString; SqlWorkflowPersistenceService persistenceService = new SqlWorkflowPersistenceService(connectionString); persistenceService.EnableRetries = true; wr.AddService(persistenceService); SqlTrackingService sqlTrackingService = new SqlTrackingService(connectionString); sqlTrackingService.PartitionOnCompletion = true; sqlTrackingService.EnableRetries = true; wr.AddService(sqlTrackingService); SharedConnectionWorkflowCommitWorkBatchService wb = new SharedConnectionWorkflowCommitWorkBatchService(connectionString); wb.EnableRetries = true; wr.AddService(wb); wr.AddService(new CallWorkflowService()); wr.AddService(new CallWorkflowWorkflowLoaderService()); Can anyone help? Thanks Gert   

System.InvalidOperationException: Instance operation is not valid on workflow runtime thread

Am getting the exception related in the title of this article when using the StateMachineWorkflowInstance object to arbitarily set state in my workflow code; and am unsure why.  The code follows below:   500     Protected Overrides Function Execute(ByVal executionContext As System.Workflow.ComponentModel.ActivityExecutionContext) As System.Workflow.ComponentModel.ActivityExecutionStatus   501    502    506         Dim smwi As StateMachineWorkflowInstance = New StateMachineWorkflowInstance(StaticWFRuntime.LocalRuntime, Me.WorkflowInstanceId)   511    512         'set workflow-wide database connection string   513         _connectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString   518    519         Utility.LogEnabled()   520    521         Utility.FoaeaLogger.WriteEntry("Processing TracingApplication.Execute()....", EventLogEntryType.Information)   522         If StaticWFRuntime.LocalRuntime Is Nothing OrElse StaticWFRuntime.LocalRuntime.IsStarted = False Then   523             Utility.FoaeaLogger.WriteEntry("No static RuntimeService object exists!", EventLogEntryType.Warning)   524         End If   525    526         Return MyBase.Execute(executionContext)   527    528     End Function   796     Private Sub gotoState2_ExecuteCode(ByVal sender As System.Object, ByVal e As System.EventArgs)   797    798        

Access Denied/The workflow could not copy the item workflow error after Sharepoint 2010 upgrade

We have a sharepoint designer workflow that copies a document from one library to another on the same site.  Before the upgrade to 2007 it worked fine, but now with 2010 it gives an error and cancels the workflow when it gets to the copy list item step.   The error on the workflow page: The workflow could not copy the item. Make sure the source and destination lists have the same columns and column settings.  Access Denied   Specifically it is the "copy list item current item to documentlibrary" sharepoint designer workflow action.   I have given the system account full permissions to the library and double checked that all columns are the same in both libraries. These are the verbose trace logs:   09/01/2010 09:46:04.05 w3wp.exe (0x17C4) 0x093C SharePoint Foundation Workflow Infrastructure 72er Medium System.UnauthorizedAccessException: <nativehr>0x80070005</nativehr><nativestack></nativestack>Access denied. at Microsoft.SharePoint.SPFile.UpdateInternal(Boolean migrationSemantics, Boolean reGhost) at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitCopyFile(Transaction txn, Object[] transData) 09/01/2010 09:46:04.05 w3wp.exe (0x17C4) 0x093C SharePoint Foundation Workflow Infrastructure 72fe High Error in commiting pending workflow batch items: Sys

Reuse XAML Declarative Workflow in Workflow Service (xamlx) Results in Server Error of System.Argume


We attempted to reuse a XAML (declarative activity workflow) in a few places within the same XAMLX and it doesn't appear to allow this.   On the WCF client side, it reported an obscure error of something to the effect of unknown message received and a communication error stating the service instance couldn't be used at this time and to ensure the call order is correct or order delivery guarantee is enabled.   However, this appears to mask the true issue which is on the server side.   Apparently, when the server side WCF end point is trying to start the workflow instance, it throws this error building a dictionary of workflow children...

System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Activities.Debugger.InstrumentationTracker.InitializeUninstrumentedSubRoots()
   at System.Activities.Debugger.DebugManager.EnsureInstrumented(Activity activity)
   at System.Activities.Debugger.DebugManager.OnEnterState(ActivityInstance instance)
   at System.Activities.Debugger.DebugController.ActivityStarted(ActivityInstance activityInstance)

System.Workflow.Runtime.QueueException + SPWorkflowExternalDataExchangeService



I have implemented a WorkFlow Service part of a state machine workFlow and time to time I get an error :

Engine RunWorkflow: System.Workflow.Activities.EventDeliveryFailedException: Event "EmailOfferReceivedWorkflow" on interface type "OnBoardingStateWorkFlow.IEmailOfferWorkFlowService" for instance id "c67fc126-729f-4a61-802e-ac09b26282c3" cannot be delivered. ---> System.Workflow.Runtime.QueueException: Queue 'Message Properties  Interface Type:OnBoardingStateWorkFlow.IEmailOfferWorkFlowService  Method Name:EmailOfferReceivedWorkflow  CorrelationValues:  ' is not enabled.

Any idea ?






Access Denied error when attaching VS2008 workflow debugger to 64-bit IIS if VS2008 user differs fro

I am trying to attach VS2008 to debug a workflow hosted in IIS (using the workflow debugger option so I can step through the visual workflow designer breakpoints, not the managed code debugger).  It is actually a WF 3.5 WCF workflow service hosted in IIS but I don't think that is the issue.  When I attach from VS2008 I always get the error "Unable to attach to process.  Access is denied."

I can attach for managed code debugging no problem.  Also, if I configure the IIS worker process app pool to use the same account as the account I am running VS2008 under I can attach not problem and debug using the workflow debugger.

So my remaining problem is that I would like to be able to attach while running VS2008 as my normal user account and leave the w3wp.exe app pool running as the usual networkservice account so that my debugging represents how the w3wp.exe will act in production.  I'm on Vista SP1 64-bit with .Net 3.5 SP1 and VS2008 SP1. 

Q: Is there a special privilege I can grant the worker process account so that I can debug while using a different user account?

I saw a very old post here http://blogs.msdn.com/sonalic/archive/2006/05/10/594703.aspx that hinted there is something special for 64-bit.  Does anyone know if there is something special about 64-bi

Access Denied error on custom workflow task list item


We have created a two level custom approval workflow on (an InfoPath) form library using SharePoint Designer (SPD) with first and second approver. The workflow works fine as long as the approver is in the Site Collection Administrators group. The approvers who are not in the admin group can get to the custom Task form for approve/reject, but they can only view the form. When they click on the “Edit Item” button of the task list item, they receive “Access Denied” error. We have given these approvers “Approve”, “Contribute” permissions on the Form library and even Full Control on the task form list (all items). Note: The users use their domain account and the error they are getting is: Access Denied, You are currently signed as DomainName\LoginName, Sign in as a different user.

We have read through several forums and have found people having the same issue. We tried all of the suggestions described in the following links - but no success so far.

SharePoint Designer Workflows, Tasks, and the Annoying “Access Denied” Error

Error submitting form with anonymous access because of workflow


Hi All,

I’m running MOSS 2007, not using InfoPath.

I have a list set up to accept registrants for upcoming events. A customized form was attached to the list to collect sign-up information. The registrants may be authenticated users or people outside of the organization, so I enabled anonymous access for the list, with permissions to Add Items. Once the form is submitted, users are directed to a Thank You page. Two workflows were also added: the first to send an e-mail saying "thank you for registration"; the second, an Approval workflow to approve or reject registrants and send a follow-up e-mail regarding their status.

When the input form is submitted, the process works fine for authenticated users. The data for anonymous users populates the list as expected, but an Error page is generated: "The data source control failed to execute the insert command."  Through research, I've since learned that workflows cannot be initiated by anonymous users. I changed both workflows to start manually, and when that didn't work, I turned them both off completely, but the problem persists.

I've read about impersonation, RunWithElevatedPrivileges, event handlers and automatically signing in anonymous users as a Guest. But I don't have access to the servers and I'm not a programmer, so I need an easier solut

Workflow Runtime Crashed with Access Violation Exception




We have an AddInProcess32.exe hosting Workflow Runtime (.Net 3.51 SP1) and the program is targeted to run on a Windows 2008 server (SP2). During the stress testing, some 30-60 workflows were be executed by the program repeatedly for a few days. Everything looked fine except at one time  AddInProcess32.exe crashed with information at Windows Log

Faulting application AddInProcess32.exe, version 3.5.30729.1, time stamp 0x488ef947, faulting module mscorwks.dll, version 2.0.50727.4206, time stamp 0x4bf4c6a7, exception code 0xc0000005, fault offset 0x00024414, process id 0x%9, application start time 0x%10.

.NET Runtime version 2.0.50727.4206 - Fatal Execution Engine Error (73227B6E) (80131506)


We don't have any COM interop or PInvoke. Also, the failed workflow type has been executed successfully more than one thousand times except the one crashed above.


With WinDBG and the crashed dump file, we managed to get the calling sta

Exchange 2000: Web Storage System, Workflow Tools, and CDO Turbocharge Collaboration Apps


Microsoft Exchange 2000, the upcoming version of Exchange Server for Windows 2000, provides many new features including integration with Active Directory, Web Storage System events and forms, and a new version of Collaboration Data Objects (CDO). Exchange 2000 also provides a workflow engine and design tool to create workflow applications. This article will give you an overview of these new features and looks at ways to do a few standard tasks with the new version of CDO. Also included is a sample workflow application that manages the posting of messages to a public server to illustrate the new workflow engine and workflow design tool.

Sean McCormick

MSDN Magazine July 2000

Nintex Workflow Error: No workflows are waiting for a BizTalk message [...] No processing has been d



I created a Workflow with Nintex Workflow 2007 (on SharePoint 2007) to send/receive data to BizTalk 2009. It worked fine already. But now I get the following error mesage in the EventViewer:

Nintex Workflow; Build: 11000 (http://ls457/_layouts/nintexworkflow/BiztalkHandler.ashx)
No workflows are waiting for a BizTalk message with message Id of 'GeneralAccessRequest_2010-08-23T15_00_04_44961212B370C554EDFAC41C1201ED6CEFB' on teamsite http://ls457/sites/testapp. No processing has been done.

What could that mean? Any ideas? I definitely changed nothing on the orchestration or BizTalk administration. The BizTalk action sends the data correctly to it's destination (database), but it seems that nintex doesn't receive any return data. I don't think it's a BizTalk problem, because in the BizTalk Message Tracking Database the Message is listet, so it has been sent correctly by BizTalk. But the handler probably has problems to find/receive this message.

Kind regards,


Workflow Runtime

I was going to build one for myself, but has anyone developed a full-featured, production caliber WF 4.0 runtime for ASP.NET which includes persistence and dynamic control of instances?  I was hoping to just buy one to save time.

Custom sequence activity deriving from System.Workflow.Activities.SequenceActivity

Hi, I try to create custom sequence activity. I found some sample (http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/f54e8eb2-29d9-46f6-ad96-766fe6fad333/). But this custom activity looks ugly (to separate nested activity using ellipses instead of arrows). My question is - how to create custom sequence activity, which will look like sequence activity. I also found this sample - <ContentPresenter x:Uid="ContentPresenter_1" Content="{Binding}" Style="{x:Static sacdt:DesignerStylesDictionary.SequenceStyle}"/> When I used this ContentPresenter my custom activity looks like System.Workflow.Activities.SequenceActivity, but I couldn't put on it another activity. I also created class, which derives from System.Workflow.Activities.SequenceActivity, but I couldn't see it in toolbox. My question is - how to create class, which derives from System.Workflow.Activities.SequenceActivity and is visible in toolbox or how to use ContentPresenter for sequence activity, which allows put on itself another activity.

Error loading workflow services

Hello, I'm developing a service library using the new wf 4.0 and one of my requirements is that some activities have the ability to be resumed by a client, so i created a wcf resume service that could load a workflow definition and resume a bookmark of that workflow. One of the services i created was a flowchart that has a receive reply activites inside a sequence activity has a start point, after that i have another sequence that have another sequence, yes 2 sequence activities, and my custom activity that needs to be resumed by a client. The 2 nested sequence activites was a something i used only for testing, but if i had those 2 sequence activities nested i got an error when loading that workflow definition in my resume service: 'ObtemPareceres' is not of type 'Sequence'. When loading this instance you must ensure that the activity with name 'ObtemPareceres' implements 'Sequence'. The "ObtemPareceres" is my custom activity, and if i remove that second nested sequence everything works fine. Anyone has any idea of whats going where? thanksFrederico Regateiro

Workflow Runtime and Long Running Processes

I am trying to get a handle on the fact that applications have to manage the persistance of workflows directly. in 4.0.  If I set a workflow to run every night at 3:00 AM and then be persisted, how will I know that my application will be awake and ready to do the job.  I know that SharePoint currently uses a timer on the server which fires off every 5 minutes (default). 

WCF Workflow Service Hosting

Is there any way I can host a WCF Workflow Service Application in a Windows service instead of IIS?

can a Workflow access a stored procedure and pass the parameters from the list data to the stored pr

The reason that I would like to consider this functionailty is because my table architecture is complicated and I do not want to modify my master table to accept all of this data where some of the data should be normalized into sub tables.  Has anyone see evidence of the stored-procedure parm approach?  Is this best accomplished through VS 2010 or can I do it through SPD? Thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend