Visual Studio "Application failed to start because the application configuration is incorrect" error
I obtained some code from a friend, developed on the same system (Windows 7) and same Visual Studio Ultimate 2010, with all the libraries relatively mapped.
The code builds, but when trying to run it I get the error:
Application failed to start because the application configuration is incorrect"
Running Dependency Walker on the executable showed that msvcr90.dll, ieshishm.dll, ieframe.dll and freeglut.dll could not be found. I copied these to the execs directory and that solved these problems. However, two issues remain:
Error: The Side-by-Side configuration information for "e:\projects\darwin\code\debug\GLTEMPLATE.EXE" contains errors. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-li开发者_开发百科ne sxstrace.exe tool for more detail (14001). Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
With SHLWAPI.DLL and IEFRAME.DLL modules being marked red (assuming error message relates to these two, how do I fix that?).
Also, the sxstrace gave following result:
Begin Activation Context Generation.
Input Parameter:
Flags = 0
ProcessorArchitecture = x86
CultureFallBacks = en-US;en
ManifestPath = E:\Projects\Darwin\Code\Debug\GLTemplate.exe
AssemblyDirectory = E:\Projects\Darwin\Code\Debug\
Application Config File =
INFO: Parsing Manifest File E:\Projects\Darwin\Code\Debug\GLTemplate.exe.
INFO: Manifest Definition Identity is (null).
INFO: Reference: Microsoft.VC90.DebugCRT(...)
INFO: Resolving reference Microsoft.VC90.DebugCRT
INFO: Resolving reference for ProcessorArchitecture x86.
INFO: Resolving reference for culture Neutral.
INFO: Applying Binding Policy.
INFO: No publisher policy found.
INFO: No binding policy redirect found.
INFO: Begin assembly probing.
INFO: Did not find the assembly in WinSxS.
INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Did not find manifest for culture Neutral.
INFO: End assembly probing.
ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
ERROR: Activation Context generation failed.
End Activation Context Generation.
(...)
And some more similar.
I also tried changing the runtime library as suggested on other related posts from multi-threaded debug DLL (/MDd) into multi-threaded debug (/MTd). However, I get the:
MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _printf already defined in LIBCMTD.lib(printf.obj)
And some five more similar. Excluding LIBCMTD.lib allows me to build. However, I still cannot run the application. I get the same error as in the very beginning.
What is going wrong and how do I fix this?
No other related posts gave me the answer so far.
Your project uses one or more libraries that were built with Visual Studio 2008, the previous version of Visual Studio. They require the C runtime library for that version to be available; that's why it is complaining about msvcr90.dll. You've got Visual Studio 2010; you only have msvcr100.dll installed on your machine.
Just copying msvcr90.dll isn't going to work; that DLL needs to be installed in the Windows side-by-side cache. You can get an installer from Microsoft or from your friend. That's, however, not the true fix; you still have a problem with your application depending on two versions of the CRT. Very unhealthy, that can cause very-hard-to-diagnose crashes and memory leaks. You need to get the libraries rebuilt with Visual Studio 2010. That's where my advice fizzles out; I can't guess what those libraries are from your question.
"msvcr90" <- I'm pretty sure that's not the 2010 version; not the release anyway. My bet is that somewhere in the mix you're linking to something built against an older runtime but not old enough to be installed with win7.
You don't want to switch to the static runtime while linking to 3rd party DLL's, or your own DLL's.
It is possible the problem in manifest. I set Configuration Properties/Linker/Manifest file/ Generate manifes==No and program began starting.
精彩评论