Printing Pipeline Errors

Discussions related to SoftPro Select user interface development.

Moderator: Phil Barton

Post Reply
roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Printing Pipeline Errors

Post by roteague »

I upgraded to SP7 and refactored by PrintPipeline. However, now when I try to print the debugger stops in my class with the following error:

Code: Select all

System.InvalidOperationException was unhandled
  Message="Collection was modified; enumeration operation may not execute."
  Source="mscorlib"
  StackTrace:
    Server stack trace: 
       at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.KeyCollection.Enumerator.MoveNext()
       at SoftPro.Select.Managers.PrintDispatchManager.HandlerRegistrationCache.RemoveRegistrationsForFailedPackages(IPackageManager packageManager)
       at SoftPro.Select.Managers.PrintDispatchManager.HandlerRegistrationCache..ctor(IServiceProvider serviceProvider)
       at SoftPro.Select.Managers.PrintDispatchManager.SoftPro.Select.Shell.Printing.IPrintDispatchManager.get_RegisteredHandlerSequence()
       at SoftPro.Select.Printing.PrintDispatcher.RunSequence(IPrintJob printJob)
       at SoftPro.Select.Printing.PrintDispatcher.Start(IPrintJob printJob)
       at SoftPro.Select.Printing.PrintJob.SoftPro.Select.Shell.Printing.IPrintJob.Run()
       at SoftPro.OrderTracking.Controls.Documents.ProcessOutput(List`1 requests)
       at SoftPro.OrderTracking.Controls.Documents.OnDocumentDealerCompleted(Object sender, DocumentDealerCompletedEventArgs e)
       at SoftPro.DocumentDealer.DocumentDealer.Stop(Status completionStatus)
       at SoftPro.DocumentDealer.DocumentDealer.ProcessNext()
       at SoftPro.DocumentDealer.DocumentDealer.Start()
       at SoftPro.OrderTracking.Controls.Documents.DoJob(OutputMode mode)
       at SoftPro.OrderTracking.Controls.Documents._printButton_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at Janus.Windows.EditControls.UIButton.OnClick(EventArgs e)
       at SoftPro.Common.Controls.CommonButton.OnClick(EventArgs e)
       at SoftPro.UI.Controls.SoftProButton.OnClick(EventArgs e)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at SoftPro.Common.Controls.CommonButton.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at SoftPro.Select.Runtime.OnRun()
       at SoftPro.Select.Runtime.Start()
       at SoftPro.Select.Automation.EnvICE.Start()
       at System.Runtime.Remoting.Messaging.Message.Dispatch(Object target, Boolean fExecuteInContext)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at SoftPro.Select.Automation.EnvICE.Start()
       at SoftPro.Select.Automation.EnvICE.Run(String rootSuffix, Boolean noSplash, Boolean setupMode, Boolean log, Boolean embedding, Dictionary`2 args, String freeArg)
       at SoftPro.Select.Program.Main(String[] args)
  InnerException: 
Any idea what is going on here?

Thanks,
Robert
Mark McKenna

Re: Printing Pipeline Errors

Post by Mark McKenna »

The immediate problem (the exception that occurs) has been addressed in our current release cycle. However, this is only a symptom of a package load failure. The first time a print job is about to be run on the pipeline, it loads up all the dispatch handler entries from the Registry and attempts to put them in their correct order of execution. As part of this, it also attempts to remove the dispatch handlers that are associated with a package that has failed to load. That is why RemoveRegistrationsForFailedPackages is having to do something that causes the exception. The issue, therefore, is the load failure of a package that also defines a dispatch handler. You can look at your Select log file to see which package failed to load - in fact, there should be an entry starting with "Removing dispatch handler..." right before the exception you provided that provides information not only about the handler being removed, but about the package from which it was defined, as well.
roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Printing Pipeline Errors

Post by roteague »

Thanks Mark, I found the bad registry entries and removed them. I was trying to get both Pre and Post processing handlers in the same dll, and obviously go the registration badly messed up. Any, I've got them both in the same dll now, with no more printing errors.

Thanks for your help,
Robert
Post Reply