Hi;
I made a ATL/MFC application using VS 2008 but its exe is not running on Win Xp or Windows 7.
My OS is Windows XP 2002 with Service Pack 3.
What could be the problem?
Doing some .net Framework Service packs doesn't seem to help much as I already checked with .net sp 2.0.

Error I get is.

The application configuration is incorrect. The application failed to start. To resolve this problem, reinstall the application.

Dani AI

Generated

Short, practical checklist to diagnose and fix the "The application configuration is incorrect" error for a native ATL/MFC app.

As suggested, this is usually a native runtime/manifest/side‑by‑side problem — .NET service packs won't help a native MFC/ATL executable. Try the following steps in order.

  1. Capture the activation error (SxS) — on Vista/7 use sxstrace to get a readable trace:
sxstrace.exe trace -logfile:sxstrace.etl
# reproduce the failure
sxstrace.exe parse -logfile:sxstrace.etl -outfile:sxstrace.txt

Open sxstrace.txt and look for the assembly identity and the exact reason the activation failed (missing version, architecture mismatch, etc.).

  1. Check native dependencies with Dependency Walker (depends.exe). On the target machine run Profile -> Start Profiling and launch your EXE; the profile shows which DLL load actually fails at startup. Be careful: static analysis can show benign warnings, so use the runtime profiling mode.

  2. Verify bitness and build settings. Confirm whether the EXE is Win32 or x64 (use dumpbin or depends). If the EXE is 64-bit it won’t run on 32-bit XP. In VS2008: Project Properties -> Configuration Properties -> General -> Platform should match your target.

  3. Remediation options:

  • Install the matching Visual C++ redistributable for your VS build (x86 vs x64).
  • Or rebuild to avoid the external CRT: C/C++ -> Code Generation -> Runtime Library = Multi-threaded (/MT) and, if using MFC/ATL, set "Use of MFC" to "Use MFC in a Static Library". Static linking removes the need for the VC runtime installer.
  • As a last resort use a proper installer that installs the VC++ redistributable rather than copying runtime DLLs by hand.

If you still see the error, post the sxstrace.txt and the Dependency Walker profile along with: exact VS configuration (Debug/Release), target platform, and whether you embedded a manifest. That information makes diagnosing the specific missing assembly straightforward.

This is usually caused by your application's manifest file, which might refer to a wrong version of the redistributable VC90.CRT/MFC/ATL dll package, or these packages may not be installed on the traget machine. If you haven't embedded your application's manifest file, then you can see a line in the manifest that looks like this: <assemblyIdentity type="win32" name="Microsoft.VC90.MFC" [B]version="9.0.30729.1"[/B] processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity> . The bold red text indicates the version of Microsoft's redistributable dll control that your app was compiled against. This may not match the version that the target system has installed, or that package may not even exist. There are several ways to fix this. See this for more information: http://msdn.microsoft.com/en-us/library/ms235624.aspx

I usually prefer distributing my applications as Shared Side-by-Side Assemblies,which is far more convenient for small apps. See this page on how to deploy apps by this method.

Hope this helped :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.