We are moving our .net 4.8 web services from Web API/AutoFaq to ServiceStack/Func. We have moved perhaps 100 types and created more than 300 routes with no issues. We had to create DTOs but the code in the service stayed largely the same. We recently stated getting the attached exception. We dutifully marked up the impacted types with the [Serializable] attribute. The exception persisted. The exception was the same but the identified class name changed so we knew/thought we were making progress. We started adding the attribute to the entire codebase (100’s of types), until it became obvious there was something else going on and this exception was a red herring.
The server was working flawlessly until about 1 month ago. About that time we added a 3rd party SDK (Lead Technologies) to the server and start performing some image processing. Its only then when we get this exception. To be clear, the entire system works flawlessly until we go through a code path that uses func and Lead.
We had an issue about a month ago where the ServiceStack serialization could not serialize a Lead type. We had to design around that. If I had to guess I would bet there is something in Lead that func does not like.
This exact tech stack works in Web API/Autofaq and fails consistently in ServiceStack/func. If we wire the interfaces and types manually, take func out of the stack it works just fine. I’m fairly confident we narrowed the issue to func and Lead.
I’m guessing the binary serialization is happening to cross app domain boundaries.
We are stuck. We want to continue to use func but we cant - at least as it is configured now. I have read the IOC page on your site - unsure if any there will help us. Please advise.