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)
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.
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