Sign in to follow this  
CDProp

Runtime error, possibly related to Visual Studio redist...

Recommended Posts

CDProp    1451
Hello all, When I try to run my program on a machine that isn't the one I built on, I get the following error: This application failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem. I checked the project property pages, and I am generating a manifest file (/MANIFEST), and I am embedding the manifest (the option is set to Yes). So, my understanding of it is that I shouldn't be getting this error, but maybe I'm wrong. I have another application that runs just fine. I tried to look for any obvious differences between the two in the property pages, but couldn't really find anything. The one that works is an MFC app. I don't know if that makes a difference. Anyway, I also tried opening both apps in depends.exe, and sure enough, the app that works is able to find MSVCP90.DLL (and others), and the app that doesn't work can't find it. Thank you. Edit: I should mention that I'm using Visual Studio 2009, programming in C++ [Edited by - ApochPiQ on November 12, 2009 3:51:32 PM]

Share this post


Link to post
Share on other sites
CDProp    1451
Hmmm, strangely enough, I cannot find a foo.embed.manifest for the non-working app. I can only find a foo.intermediate.manifest for it.

I do have the Embed Manifest option set to Yes, though. Here is what I have under Configuration Properties => Manifest Tool => Input and Output:

Additional Manifest Files: (blank)
Input Resource Manifests: (blank)
Embed Manifest: Yes
Output Manifest File: $(IntDir)\$(TargetFileName).embed.manifest
Manifest Resource File: $(IntDir)\$(TargetFileName).embed.manifest.res
Generate Catalog Files: No
Dependency Information File: $(IntDir)\mt.dep


And here is what I have under Configuration Properties => Linker => Manifest File:

Generate Manifest: Yes
Manifest File: $(IntDir)\$(TargetFileName).intermediate.manifest
Additional Manifest Dependencies: (blank)
Allow Isolation: Yes
Enable User Account Control (UAC): Yes
UAC Execution Level: asInvoker
UAC Bypass UI Protection: No


Here are those same options, for the MFC app (the one that works):

Configuration Properties => Manifest Tool => Input and Output:

Additional Manifest Files: (blank)
Input Resource Manifests: (blank)
Embed Manifest: Yes
Output Manifest File: $(IntDir)\$(TargetFileName).embed.manifest
Manifest Resource File: $(IntDir)\$(TargetFileName).embed.manifest.res
Generate Catalog Files: No
Dependency Information File: $(IntDir)\mt.dep


Configuration Properties => Linker => Manifest File:

Generate Manifest: Yes
Manifest File: $(IntDir)\$(TargetFileName).intermediate.manifest
Additional Manifest Dependencies: (blank)
Allow Isolation: Yes
Enable User Account Control (UAC): Yes
UAC Execution Level: asInvoker
UAC Bypass UI Protection: No


Note that they are identical, at least on these two property pages.

But curiously enough, I can find the *.embed.manifest for the MFC app (the one that works) but not the app that doesn't work.

Just in case, here is the *.intermediate.manifest for the app that doesn't work (sorry about the lack of source boxes; I tend to have trouble with those when using languages that the source box does not support):


<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.DebugCRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>


Here is the *.intermediate.manifest for the app that does work:


<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.MFC' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>


And here is the *.embed.manifest for the app that does work:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Microsoft.Windows.SAD" type="win32">
</assemblyIdentity>
<description>Your app description here</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*">
</assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b">
</assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.MFC" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b">
</assemblyIdentity>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false">
</requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

Share this post


Link to post
Share on other sites
CDProp    1451
The plot thickens...

The computers I'm trying to run the app on already have the redistributable installed (Microsoft Visual C++ 2008 Redistributable - x86 9.0.21022).

Share this post


Link to post
Share on other sites
CDProp    1451
If I open the executable with Notepad++ this is what I see (an older build, because I have to use another computer for the moment, but the build should be identical):


<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>

Share this post


Link to post
Share on other sites
ApochPiQ    23003
The main thing I see is that your non-working app references the Debug CRT, which as far as I know is not part of the standard Visual Studio redist packages. Unless you have done something with referencing debug .libs in your non-working project, my guess is that you're trying to run a Debug build on the other machine rather than a Release.

Share this post


Link to post
Share on other sites
CDProp    1451
Nah it's release, but this app has such a complex web of dependencies it's very possible that there was a debug lib thrown in there. I'll check tomorrow, thanks.

Share this post


Link to post
Share on other sites
ApochPiQ    23003
Glad you got it sussed out [smile]


Slightly off-topic - please don't mark threads as "solved" in the General Programming forum, as that can discourage further useful contributions to the discussion.

Thanks and good luck! [smile]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this