Error Code: 0xC0150002 : The application failed to initialize properly. Click on Ok to terminate the application.

I was in the process of making a few changes to a DLL, and whenever I ran the application on any machine other than mine with this new DLL, I got the message : "Error Code: 0xC0150002 : The application failed to initialize properly. Click on Ok to terminate the application.". Now, this error message isn't very nicely documented, even by Microsoft. In fact, their website claims this error is caused because of some Office 2003 -WinXP Pro combination. My error has nothing to do with that.

I eventually found a pointer at one of the forums (due credit, but I can't find the website anymore!). So how to fix it. Do this:
Open both the old DLL that works, and the new DLL you made that refuses to port onto another computer in Visual Studio. Expand the tree and see the Manifest Version. Are they different? Voila! (Assuming they are ofcourse). The problem is that when your runtime MS DLL's (msvcrt family) belong to a VS installation other than yours, your new manifest embedded in the new DLL is unable to use them, hence the crash.

Solution? Recompile the DLL on a machine with the same manifest/VS version. Try again.

Hope this helps!

Labels: , ,


About this entry