1

I have created an MFC application using Visual Studio 2008 which is working fine on Windows XP. But when I try to execute the same EXE file in Windows Vista I am getting:

Error: Application has failed to start because its side-by-side configuration is incorrect

When I check the event viewer then below is what it says:

Log Name:      Application
Source:        SideBySide
Date:          12/10/2010 10:06:08 AM
Event ID:      33
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      WIN-8A4INI0BH2R
Description:
Activation context generation failed for "C:\MyApp.exe". Dependent Assembly Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="SideBySide" />
    <EventID Qualifiers="49409">33</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2010-12-10T04:36:08.000Z" />
    <EventRecordID>181</EventRecordID>
    <Channel>Application</Channel>
    <Computer>WIN-8A4INI0BH2R</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"</Data>
    <Data>
    </Data>
    <Data>

    </Data>
    <Data>C:\MyApp.exe</Data>
    <Data>
    </Data>

    <Data>
    </Data>
  </EventData>
</Event>
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Simsons
  • 12,295
  • 42
  • 153
  • 269
  • 1
    Have you installed the correct VC90 CRT on the Vista machine? – James McNellis Dec 10 '10 at 05:12
  • @James McNellis, No. Does this mean user also have to install VC90 CRT on their Vista Machine to run my application? – Simsons Dec 10 '10 at 05:25
  • @Subhen, the answer is yes. See http://stackoverflow.com/questions/203195/how-to-detect-vc-2008-redistributable – Android Eve Dec 10 '10 at 05:30
  • @James McNellis, It worked, Should be answer – Simsons Dec 10 '10 at 06:59
  • @Subhen: It doesn't mean you have to install VC90 CRT on all Vista machines. You have 2 options: link runtime statically, use private assemblies (just copy manifests and crt files to your app directory). – DReJ Dec 10 '10 at 08:23
  • Related: *[Prevent "The application has failed to start because its side-by-side configuration is incorrect..." error starting Access](http://support.microsoft.com/kb/2525435#)* (Microsoft support). It should work for other applications than Access. – Peter Mortensen Jan 16 '15 at 14:14

2 Answers2

7

You have no CRT runtime DLL on the target machine. To avoid this you can install VC9 redistributables or you can link your program with the runtime statically (more info). This question could be helpful also.

Community
  • 1
  • 1
Kirill V. Lyadvinsky
  • 97,037
  • 24
  • 136
  • 212
  • You can also used private assemblies, e.g. under your application directory there can be a directory called "Microsoft.VC90.CRT" containing the runtime DLLs. The app will then automatically find them. This is very useful if the application needs to be distributed without installation permissions being available and saves installing the whole CRT. See http://stackoverflow.com/questions/787216. – chrism1 Dec 10 '10 at 09:39
  • For resolving issues with private assemblies, take a read of this excellent article - http://buffered.io/posts/resolving-side-by-side-configuration-issues/ – TheJosh Sep 12 '13 at 02:28
2

I realise this is an old thread but I got this same error and none of the SO threads have a reference to the cause of the issue I had. I used the sxstrace program and it pointed me to the config file where there was a syntax issue with the XML !

Valid
  • 767
  • 7
  • 14