Windows Application presents startup error (0xc0150002) on some systems


I have a Visual Studio 2005 application that runs on some systems but not others.  The application ships with 4 dll files that reference other dlls.  These called dlls should be part of the system environment, which is the case on the machines that work.

As a temporary fix, we built the exe so that all the dll code was contained in it.  It runs fine under that circumstance. But we don't wish to leave it that way.  

I have two systems set up for testing - one that works and one that doesn't.  Both are Windows7-64 OS.   Also, I had a third non-working Windows7 disk, but installing Visual Studio 2011 beta seemed to fix it.  I can't use this approach for deployment however....

I ran sysinfo and compared the process internals on the working system with the non-working system.  The first thing that jumps out is that the path is different between the two.  Although they have pretty much the same folders in the path list, the order is not the same between them.

There may be other differences as well, this is just the first one I noted.

What can I do to isolate this somewhat random error and fix it ion standard win7 machines?

Thank you
Who is Participating?
unfortunately i know only manifest handling for (unmanaged) c++ and mfc projects in vs2008. here you can embed the manifest files (which automatically was built) into the executable like a resource.

i also achieved once to add the manifest settings for a specific version of a control into the application manifest which then doesn't need the control to get registered anymore.

when i stored the manifest settings into a .manifest file with same name as the application i could add this file to an older version of the program and it also doesn't need the control to be registered anymore.

so, as far as i remember, the rule is that a .manifest file with same name as the application exe - for example myapp.exe.manifest - was used if existing in the same folder than the application. if no manifest given it uses the embedded manifest. if still no manifest it uses defaults from target system which is less likely to work. things go worse if you have many dependencies with other manifested dlls.

but manifest creation changed with every version of visual studio and also was different for the supported languages and perhaps target os versions.

the 0xc0150002 error is an initialisation error mostly caused by missing manifests. you probably could solve them by copying the .manifest files from your built into the directory where the exe resides. you might think of embedding the .manifests into your executables. i don't know whether that already was possible with vs2005 but surely with vs2008.

note, looking into the eventvwr log should give more details.

markdolarAuthor Commented:
Ok - looking in the event viewer, I think I found the problem.    The version of the manifest is 9 on the working system and 8 on the non-working system.  The software event reported that the program was looking for a file in the 9 manifest when it crashed.

So, I am ready to take a remedial step, which is adding manifest 9, but would like to go about it in the correct fashion.  

Is there a specific place in Microsoftland where someone would get the manifest from?  Can I get the correct ones somewhere in visual studio - if so, how do I track when my programmer upgrades and inadvertently breaks it again?

If I just copy it from the working machine. what is the proper method for placing it on the target, especially considering that the path attributes between the working and non-working processes were different?

Building the manifest into the code itself is the best option I think, but the reality is that I need to fix this before that can happen.  Any additional advice appreciated; first response was spot on.

markdolarAuthor Commented:
diagnosis was good, but only partial solution provided
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.