question

Mizokunimito-3928 avatar image
0 Votes"
Mizokunimito-3928 asked AnnaXiu-MSFT edited

Workflow Foundation state serialization and VS upgrade.

Hi,

we use WF as engine on our product we're experiencing an issue that prevent us to move one project of the entire solution to be built with VS2017 obling us to compile it with VS2012.

Infact when WF tries to load persisted workflows if the mentioned assembly is built against VS2017 it raises a deserialization exception.

The reason is because when workflow should restart needs a callback to invoke and its name is part of persisted state.

As you can see below the same code on the same workflow produces differente serialization depending on the VS version used. (VS2012 is on the left)

165197-diffstate.png

The callback name is made by compiler when we attach an handler to a framework delegate,

In the following test project screen you can see a compiler create special methods if you have a delegate signature with an object argument and the handler argument is strong typed this happens since compiler made a special method that wraps the handler with a cast object to required type.


165090-vside.png
These special methods naming convention changed from VS2012 to VS2017 so basically WF doesn't find the method in the persisted state when workflow restarts.

Some ideas/attempts:

1) Look for some option compiler to build specific project with VS2017 to have backward compatibility , but we dint't find nothing yet.

2) Try to add method with legacy name this can be done with dynamic method, but it will be created in a general scope e not as part of the original object persisted in the state.

3) Update the wf state with a kind of updater to be compliant with VS2017, however the state is compressed in a binary format and is not easy to do and at the same time exposes to risks.

Any advice will be appreciated.

Thanks


not-supported
diffstate.png (75.1 KiB)
vside.png (219.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AnnaXiu-MSFT avatar image
0 Votes"
AnnaXiu-MSFT answered

Hi @Mizokunimito-3928 ,

Your issue is more related to Windows Workflow Foundation and is currently not supported in the Microsoft Q&A, the supported products are listed over here: https://docs.microsoft.com/en-us/answers/products/ (more to be added later on).

You can ask in the dedicated Windows Workflow Foundation forum over here:
https://developercommunity.visualstudio.com/report?space=8&entry=problem

Thanks for your understanding.

Sincerely,
Anna


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.