I created a project using the API for SQL Compare and SQL Data Compare (the licenses.licx is included) and added it to my solution. When my application runs, it loads all the assemblies. But it got the "Loaderlock was detected" problem: DLL 'C:\\***\\bin\\Debug\\RedGate.Licensing.Helper.dll' is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.
Is there anything I can do to avoid this problem?