Does anybody know if there is a way of preventing a memory leak in RuntimeBinder when using \"dynamic\" keyword with __ComObject instances in C#?
I got the following
The solution in my case was to replace:
dynamic o = System.Activator.CreateInstance(t);
with:
object o = System.Activator.CreateInstance(t);
dynamic d = o;
The memory leak no longer occurs having the workaround applied.
I had a similar problem: Using "dynamic" caused a memory leak.
I solved this in the following way:
using (dynamic attr = curve.Attributes)
{
if (attr != null)
return attr.InternalLabel;
}