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: , ,

Posted by Vivek at 12:25 PM | 0 comments | links to this post read on

My Photo
Name: Vivek Kapoor
Location: Delhi, India

I'm just another face in the crowd. I have the same dreams as every other engineer in the country, the same lifestyle, the same aspirations. Yet, we all feel we are so different. Maybe we are, but we do little to prove it. We do little to live by our convictions, to share our thoughts. I'm trying to do a million things at once. Thinking about my future is more a habit than a hobby, and running an e-commerce website my present biggest obsession. Yet, on paper, I'm just another software professional like so many others.. doing a 11-5 (yeah, lovely timings) job. This blog is testimony to the fact that I may not get very far, like millions of others, but still, I'm different, and hopefully, I'll get around to proving myself.