Hello, I have a C# project in which managed C++ class is used. This managed C++ class is wrapping an unmanaged C++ code.
I have code block like this;
if (true)
{
ManagedFoo foo = new ManagedFoo();
}
//GC.Collect(); // I also tried with this one but result is same
I have placed a simple output string to destructor of class.
If I run program from visual studio, destructor of foo is not called. But if I run program by double clicking on it(it is a console application), destructor is called immediately.
Why it is behaving like this?
Many thanks, Regards