Yes, because a reference to an object through an interface is still a reference to that object.
Casting an object to an interface does not create a new object, it just alters the "portal" you use to talk to the object through.
You can easily test this in LINQPad:
void Main()
{
A a = (A)new B();
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.KeepAlive(a);
Debug.WriteLine("Got here");
}
public interface A
{
}
public class B : A
{
~B()
{
Debug.WriteLine("B was finalized");
}
}
When executed, you'll get:
Got here
And then, optionally:
B was finalized
But notice that B survived the full GC cycle, even though you had a reference to it through A.