As part of this personal project I am currently working on, I need to reuse a C# component I wrote a few years back. I think I have blogged about this topic in the past on my old blog, but here I will show you how to check whether the CLR requires to be loaded beforehand, as well as a convenient way to “warm up” .NET code for execution.
.NET provides a few interfaces that enable Visual C++ developer to host and use the CLR from native code applications. In order to improve performance and minimize the load time/first execution of .NET code it’s a good practice to load all of the dependencies (assemblies) required by the target library. As you can see I use smart pointers to do all of this because .NET is COM based and when it’s not done properly one can incur in memory leakage. It’s a good thing we got smart pointers
Like I’ve previously mentioned, I needed to reuse an existing .NET assembly, well, it’s a bit of a shocker to find out the number of reference it loads even when I am not using them