Thanks
This seems to be a bit messy.
I can repro your exception easily, either using .net 5 or .net 6 (probably core 3.1, .net 4.0 (C# 4) etc. as well)
My app was running .Net 6 (with top-level statements which doesn't seem to matter)
Downgrading to .Net Core 3.1 shows same message as yours in a similar case (argument name with "wrong" case)
Using .Net 5 (C# 9 compiler) or .Net 6 (C# 10 compiler) does not show any error in my case.
The principle differences as I can see are:
1: Your program creates the type by typeof(ExampleClass), mine by Type.GetTypeFromProgID("MyProgID")
2: Your program uses a .net class (cls)
Perhaps the fact that you actually introduce the ExampleClass to the compiler makes the difference.
(The compiler has the possibility to add some metadata at compiletime even if dynamic is used, in my case with totally unknown metadata at compile time everything has to be done and cached in runtime)
Based on the observations I have to rephrase my question:
Is this case-insensitivity, using C#9 or C#10 and COM interop by the dynamic keyword stable by design (and documented? where?) or is there a risk that this may change in the future?