EDIT: Ive already changed the pattern so no “dynamic” is needed, but still would welcome insight.
I used the keyword dynamic in an interface, and now am trying to pass a Dictionary<string, dynamic> through it.
Everything looks good, and in fact “dynamic” is working for somethings, however I get a build compile error:
when trying to pass it through an interface.
EDIT: looks like I cant pass it at all.
Everybody says install NuGet and the Micrososft.CSharp package, but, if it is not compiling for me, it must not be in Unity or in any other packages, so I want to make sure it will build before I continue with this programming pattern.
I know there are people who have used the dynamic keyword and lived to brag about it, but there are a lot more people posting here who have endless difficulties with it, since like any late-binding technology, it requires workarounds to prevent constructor code stripping, it (probably) won’t work at all with AOT compilation targets (iOS and/or Android), and all manner of other issues.
The only case I would consider it is if you are ONLY targeting Windows machines, and you are willing to go through all the anti-stripping steps, plus go through them in the future when Unity changes and now starts stripping essential constructors, which happens from time to time.
Good Lord, that should be the LAST thing you should ever try. What a disaster of uselessness. Our team tried using NuGet for years and it was a constant hassle with getting dependencies wrong, unexpected updates, source control conflicts, ceaseless tinkering with our CI / CD system, it was AWFUL. Do not want.