in Microsoft Bot Framework by
Q:

How can I reference non-serializable services from my C# dialogs in SDK v3?

1 Answer

0 votes
by

There are multiple options:

  • Resolve the dependency through Autofac and FiberModule.Key_DoNotSerialize. This is the cleanest solution.
  • Use NonSerialized and OnDeserialized attributes to restore the dependency on deserialization. This is the simplest solution.
  • Do not store that dependency, so that it won't be serialized. This solution, while technically feasible, is not recommended.
  • Use the reflection serialization surrogate. This solution may not be feasible in some cases and risks serializing too much.

Related questions

0 votes
asked Jul 24, 2020 in Ionic by Robindeniel
+1 vote
asked Jan 22, 2022 in APIGEE - API Services by Robindeniel
0 votes
asked May 1, 2022 in Azure Cosmos DB by sharadyadav1986
0 votes
0 votes
asked Oct 18, 2019 in C Sharp by Robin
...