Overview:
After applying Windows Updates to your server, workflows that include images in DataTable and DataSet objects may throw an error:
There was a workflow error running activity: Exception has been thrown by the target of an invocation. Unable to load specified workflow from instance store. Unable to load workflow running instance data. Type 'System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not allowed here. See https://go.microsoft.com/fwlink/?linkid=2132227 for more information.
Some customers have reported that update KB4565511 specifically causes this error.
Solution:
This error happens when a System.Drawing.Bitmap is put into a DataTable object, and that DataTable is then serialized. In Geocortex Essentials Workflow, in-scope objects are serialized when a client activity is run.
While the approaches described in the Microsoft article will all work to avoid this error, we can also avoid it by using Server Scope activities in the workflow to ensure that the DataSet objects do not need to be serialized. This is a preferred approach, because it follows a good workflow practice: reducing the amount of data transferred between client and server when running workflows.
In your workflow, find the activities that manipulate the DataSet and DataTable. Add a Server Scope activity. Optionally, rename it to something easy to understand, like "Generate DataSet". Move all activities that manipulate your DataSet into the new Server Scope activity. Then, in the Variables section, update the Scope of the variables required to generate your output so that they only exist within the Server Scope activity.
You may need to keep a few variables outside of the Server Scope, to collect the results of whatever was being done on the server - usually, a report URL. Similarly, if a client activity was used in the midst of the server process you may need to move that to before or after the process.
If it is not possible to adjust your workflow to avoid serializing Bitmap objects, then we recommend using the app.config settings described in the Microsoft article to use your workflow - they are added to the Essentials web.config file. Alternatively, consider rewriting the workflow using Workflow 5. Workflow 5 does not combine client and server activities in one workflow, and will not throw this error.
After applying Windows Updates to your server, workflows that include images in DataTable and DataSet objects may throw an error:
There was a workflow error running activity: Exception has been thrown by the target of an invocation. Unable to load specified workflow from instance store. Unable to load workflow running instance data. Type 'System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not allowed here. See https://go.microsoft.com/fwlink/?linkid=2132227 for more information.
Some customers have reported that update KB4565511 specifically causes this error.
Solution:
This error happens when a System.Drawing.Bitmap is put into a DataTable object, and that DataTable is then serialized. In Geocortex Essentials Workflow, in-scope objects are serialized when a client activity is run.
While the approaches described in the Microsoft article will all work to avoid this error, we can also avoid it by using Server Scope activities in the workflow to ensure that the DataSet objects do not need to be serialized. This is a preferred approach, because it follows a good workflow practice: reducing the amount of data transferred between client and server when running workflows.
In your workflow, find the activities that manipulate the DataSet and DataTable. Add a Server Scope activity. Optionally, rename it to something easy to understand, like "Generate DataSet". Move all activities that manipulate your DataSet into the new Server Scope activity. Then, in the Variables section, update the Scope of the variables required to generate your output so that they only exist within the Server Scope activity.
You may need to keep a few variables outside of the Server Scope, to collect the results of whatever was being done on the server - usually, a report URL. Similarly, if a client activity was used in the midst of the server process you may need to move that to before or after the process.
If it is not possible to adjust your workflow to avoid serializing Bitmap objects, then we recommend using the app.config settings described in the Microsoft article to use your workflow - they are added to the Essentials web.config file. Alternatively, consider rewriting the workflow using Workflow 5. Workflow 5 does not combine client and server activities in one workflow, and will not throw this error.
Comments
0 comments
Article is closed for comments.