OJ’s rants What would OJ do?

17May/0855

Resolving Side-by-Side Configuration Issues

I've been meaning to blog about this for well over a year now, but for some reason I never got round to it. This came up in conversation the other day with a couple of workmates and it prompted me to revisit the issue.

Have you ever fired up an application on Windows XP and got the following error?

The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

Informative isn't it! What about if you fire up the same application on Windows Vista?

The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail.

This does tell us a little bit more about the problem, but not a lot more.

The fact is that the first error message above is useless, and the second is useless to everyone except those who know all about WinSxS (side-by-side). I'm not going to go into detail about WinSxS in this article, but the short description is: it's an attempt at alleviating DLL hell.

When a binary component links against a DLL, such as MS's CRT, an entry for that dependant DLL is specified in the component's manifest. This tells Windows that the application can't run without those DLLs being present. If they're not present in WinSxS then the errors above are thrown in the user's face.

To demonstrate the problem, consider the C++ program below.

#include <windows.h>
#include <tchar.h>
 
int WINAPI _tWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPTSTR cmdLine, int cmdShow)
{
  ::MessageBox(NULL,
      _T("This is a text executable that links against a later version of the runtimes."),
      _T("Test EXE"),
      MB_OK);
 
  return 0;
}

Compile this on a machine with Vis Studio 2008 installed and the resulting EXE will be linked against version 9.0 of the CRT.

Here is the result of running this on an XP machine without that runtime installed:

Windows XP Error

Here's the same application running on Vista, again without the runtime installed:
WinSxS error on Vista

Let's now pretend that we don't know why this problem is occuring and attempt to ascertain the reason for the error.

First off, we need to locate the application's manifest. This can be found either in a appname.exe.manifest file, or inside the binary itself. In our case, the manifest is embedded so we need to open up the file in a binary/hex editor (or at least an editor that allows you to view the content of binary files). I used VIM, but there are other options such as UltraEdit and the free Cynus editor.

Manifest information is usually stored towards the end of the file, so after opening it in your editor of choice, scroll to the end of the file and slowly scroll up. When you reach a section that contains what looks to be XML then you've probably found it. It usually lies just above a section of padding that looks like this:

0001ab0: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001ac0: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001ad0: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001ae0: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001af0: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001b00: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001b10: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001b20: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001b30: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001b40: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001b50: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001b60: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING
0001b70: 5041 4444 494e 4758 5850 4144 4449 4e47  PADDINGXXPADDING

The manifest XML usually begins with an assembly tag. In the case of this example, it looks like this:

0001850: e404 0000 0000 0000 3c61 7373 656d 626c  ..........
..    <
00018e0: 7365 6375 7269 7479 3e0d 0a20 2020 2020  security>..
00018f0: 203c 7265 7175 6573 7465 6450 7269 7669   ..
0001910: 3c72 6571 7565 7374 6564 4578 6563 7574  ..      ..    ..  ..  ..    ..
00019d0: 2020 2020 2020 3c61 7373 656d 626c 7949        ..    
0001a90: 0d0a 2020 3c2f 6465 7065 6e64 656e 6379  ..  ..PA

In case you don't find this very readable, here it is after extraction/formatting:

<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>
</assembly>

The bit we're really interested in is:
<dependentAssembly>
  <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>

This tells us the exact component and version required for this application to run. You'll notice that it also mentions the processor architecture. In this case, we need to make sure that we have version 9.0.21022.8 of the Visual C Runtimes for x86 installed in the side-by-side folder. The WinSxS folder can be found at %WINDIR%\WinSxS

Inside that folder you'll probably see a stack of subfolders with crazy looking names. The one you would need to have to solve the problem above is called x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91, which as you can see has a name that closely resembles the properties of the assemblyIdentity tag in the XML listed above.

If you can't find the appropriate folder in your WinSxS then you need to download an installer that contains the appropriate components and install it.When installed, the application should run without a problem, and you should get a message like this:
The resulting message box shown when the test application\'s side-by-side configuration is correct

Hope that helps!


Edit (3rd Jan '09): A nifty tool has been built by Kenny Kerr which makes viewing manifest information much easier. Pointer your browser this way and check it out. It should help when tryinig to resolve this problem.

  • stevekershaw
    Hiya OJ. I am getting the "The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail." message when my kids try to install games. I am not very well up on computers and have been looking for an easy way to fix the problem. I dont want to get rid of the games if there is an easy solution. Could you please reply to stephenmkershaw@hotmail.com with any help you could provide. Many thanks.
  • Sally Shine
    Thanks, although I reinstalled Windows out of frustration. Might as well take a peek into the problem next time, though.
  • OJ
    Bear in mine that Side by Side errors might occur when one of the DLLs your program relies on is missing one of it's dependencies. That is, make sure your entire dependency tree exists. Depends.exe is a great tool for visualising this.
  • Sally Shine
    I ran into this problem while trying to load Sketchup. Tried installing the runtimes a gazillion times already, only to piss me off with an annoying SxS conflict message. I then viewed the manifest using Reshack, and it calls for version 8.0.50727.762 of CRT and MFC.

    Can anyone give me a clue on how to fix this, without reinstalling Windows?
  • triniwondaboy
    Did a search and its in the system32 folder
  • OJ

    @triniwondaboy: IESHIMS.DLL comes with Internet Explorer and should be in "Program Files\Internet Explorer". If it's not, then that's one thing you could try and fix. But I don't think that's your problem as Depends.exe throws that up quite a bit.


    The other file, GPSVC.DLL, is something to do with Group Policy and should come direct from MS. It appears that on Vista RTM that file was missing (apparently). Can you do a file search in System32 and WinSxS to see if that file exists?


    If not, that's your problem. If it is there, ping me again we'll try another option.

  • triniwondaboy
    GPSVC.DLL
    IESHIMS.DLL

    These are the DLLs that are showing up red in the module window.  Its says Error opening file. System cannot find the file specified (2)
  • OJ

    @triniwondaboy: Drag and drop the msnmsgr executable into the program (it looks like you've done that already). In the window, you should see a list of binaries that the exe depends on. If you see anything red, that's bad! So list them here so we can figure out what is missing.


    The error message you are getting is a definite indicator, but we need to see the files that are missing in that depends list.

  • triniwondaboy
    For some reason I think that has nothing to do with my problem
  • triniwondaboy

    Warning: At least one delay-load dependency module was not found.
    Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

    This what I got from depends
  • triniwondaboy
    I downloaded it but to be honest I'm not sure how it works.
  • OJ

    @triniwondaboy: According to that message, you need download and install this. If you have downloaded and installed that, then something else is missing.


    What does Depends.exe tell you?

  • triniwondaboy

    Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
    C:\Program Files (x86)\Windows Live\Messenger\msnmsgr.exe


    This is the message that my event viewer is giving me and I'm running 64-bit. Its the same dependency as far as I can see.
  • OJ

    @triniwondaboy:


    Thanks for the comment. This happens quite often when service packs are applied. All kinds of things can go wrong.


    Given that you've followed the steps, can you perhaps give me a little more information? Have you opened up the messenger executable using Depends.exe to find out which one of the dependencies is missing? are you running x64 or x86? Are you sure you've managed to get a list of all of the dependencies you require?


    Cheers.

  • triniwondaboy
    Hey OJ,

    I totally agree with everyone that this is the closest thing I've gotten to a solution to the problem. Unfortunately though I have done everything listed in this thread and still have the side-by-side error for windows live messenger.
    Ever since I did the last SP install I have not been able to use messenger. I have the x86 folder with the 3 dll files. I tried the install of the two VC++ files as administrator and still have the same problem.
    Right now I'm at my wits end and ready to toss this laptop out the second storey window. Anything else that I can try to solve this problem?
  • OJ
    @Q: I'm sorry to hear that it didn't solve your problem. I'd just like to highlight one thing: even though it's still not working it doesn't mean that what you installed didn't at least alleviate the problem.

    That is it may have solved the problem that you had initially, but perhaps now there is another dependency that it needs which it can't find?

    At this point, may I suggest that you fire up Depends.exe and view the exe that you're trying to run. See if it tells you which DLL it's not able to find.

    I'm happy to chat to you about this real-time if you like. Ping me your email address via the contact form (please write it in the body of the mail as well ;)) and we'll figure out a way to converse.

    Thanks for your kind words :) Reformatting is still a way off! I think we can solve it.
    OJ
  • Q
    Tried both no luck.  I must say you have the most knowledge about this problem on the entire internet.  So what's are my option (if any) besides reformatting?
  • OJ
    @Q: Thanks for your post mate. Have you tried installing the redist for x64 first? You may find that it installs the x86 stuff behind the scenes?
    <div>
    </div>
    <div>Try downloading and installing this and this (make sure you run as admin) and try again. Let me know how it goes.</div>
    <div>
    </div>
    <div>Good luck :)</div>
  • Q
    Hey OJ since you seem like the man at this stuff.  Let me tell you where I am.  This "Side-by-side configuration error"  Is everywhere on my Vista 64.  I can't use Photoshop, Acrobat, and some random applications.  Now I went into the manifests and found

    x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada.manifest
    &
    x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada.cat

    I tried installing the Microsoft Visual C++ 2008 Redistributable package "right clicking run as administrator"  but it doesn't seem like it goes through the entire installation.  It gets to "Gathering information" and just dissappears. 

    I successfully installed

    Microsoft Visual C++ 2008 SP1 Redistributable Package (x86).
    I don't have Visual Studio so what am I missing?  Thanks in advance for all your work
  • OJ
    @Rob: Er, yeah :)

    @Steven: You're in a world of hurt mate. There's a lot gone on there that I really can't help with via a set of comments on a blog. You may find that your best option is to take your machine back to where you got it and get them to reinstall office. They should give you CDs as well, because you paid for the licence of the software and hence you should be entitied to reinstall it if required.

    Sorry. While I'm happy to share my experiences, I can't really spend the time giving out free I.T. support. I hope you understand. Good luck!
  • Bet you didn't see that one coming! :-)

    Good luck solving it OJ...
  • Steven Jay
    Hi,
    I desperately need help, and would be grateful if you could.
    My work computer is broken, and I am the IT guy by default (Meaning I have more experience than my two colleagues!).  The bulk of this main post is over my head, for example.
    I am running Windows Vista.  I recently downloaded a program for which I had to also install Microsoft .NET framework (whatever that is).  Immediatly after that, and since, I have been unable to open any Microsoft Office programs, getting this dreaded 'side-by-side configuration' message  After reading many other website's I found I needed to download the Redistributable Package mentioned.  I did this and still had problems.  Then another website siggested uninstalling the programs that I have problems with, uninstalling the RP, then installing the RP and THEN the Office programs again.
    It still does not work.  Then I came here, and I downloaded the file and ran it as administrator, with no joy.  However, the file you mention to look for in the WinSys folder IS there.
    I have aldready got into problems because I uninstalled Office, only to realise that this PC was an 'Office ready' PC, and therefore does not have a disc to reinstall it.  I downloaded a trial and I can't open it (because of this side-by-side issue) to try and convert it to the full package.
    Any help you can give me would be gratefully recieved!
  • OJ
    @Martin: The Dependency Walker is telling you what we already know -- ie. your exe is bound to the runtimes. What we don't know is why. You need to determine which, if any, of the libraries you're linking to have a dependency to the CRT. I'm not sure which, if any, Win32 libraries have that dependency either.

    Any chance you can zip up your project and send it over so we can take a look at how it's set up?

    @governmentwhizz: The steps to follow to determine the dependency that you're missing are listed in the article already. I'm guessing you're not too savvy with VIM (I love it, but realise it's a little esoteric for people who aren't familiar with it), so I think you should use a tool that makes it easier. If you see the annotation at the bottom of my article, you'll see that I've linked to this tool, which shows you the content of the file's manifest. This will tell you what's missing without you having to do any of the complicated steps. Download it, fire it up and use it to track down your dependency. Good luck!
  • governmentwhizz
    hey oj
    im having this problem after downloading the newst msn messenger i downloaded the VIM you suggested in your blog but after that im lost. Please could you give me some steps to follow thanks id really appreciate that
  • Martin
    Hello OJ and Keef,


    Sorry for answering late but I was away. Thinks are quit strange (at least to me). So, in the project, in Release build I statically link to the CRT. Still in the manifest there is a dependency on the CRT DLL. With Dependency Walker I see "MSVCRT.DLL".  What is this file? It is included in Windows XP by default. This project uses only standard Windows libraries. How can it be possible to depend on the dynamic CRT? Any ideas will be greatly appreciated.
  • OJ
    @Keef: That probably won't help. If Martin is statically linking  libraries then the only binary that has the dependency will be the one he creates. Given that his exe's manifest is the one with the dependency, Dependency Viewer will simply say that his exe is what depends on the DLL.

    You need to find which static libs have the dependency before you link them in to your binary.
  • @Martin: Could you use a Dependency Chaser type app on your executable to work out the tree of dependencies to help you narrow down which module is pulling in the debug CRT (if its something that's not obvious from the project settings)?  We're using a nice app at work that helped me work out a Managed DirectX versioning problem the other day, though I'm not sure where it came from.  I'll look it up on Monday and post here again.
  • OJ
    @Martin: I highly recommend that you do not go with the hacking manifest solution. The manifest includes the dependency because something in the code needs it.

    Just because the program runs it doesn't mean it won't crash at any time. The thing is, when the application runs, it might not initially need to access the functions that live in the debug CRT. You may find that you'll have to perform a certain function before the program looks for the CRT, and that is the point that the application will crash.

    You obviously don't want this ;) I don't have time to download and compile the sample that you're talking about, but by the sounds of it that sample is somehow including a reference to the debug CRT.

    Can you have a look through the project settings, and all the #pragma statements, and list the libaries that are being linked? (make sure you check across all configurations). If you list them here maybe we can figure it out.

    Cheers!
  • Martin
    Hello OJ,


    Thank you for the reply. I actually build the MS LSP example from the SDK by creating a solution and two projects in VS2008. On Release buid I statically link to the C runtime library but the manifest that is embedded still has a demendency on the VC90 which is quite odd. I modified the manifest through the Resource Editor from inside VS and managed to get rid of the dependency. Now on an out-of-the-box Windows XP Home the program is running without the side-by-side error.


    I am not sure if this workaround should be done or should I keep on searching for some project properties since I think the problem is in them.


    Martin
  • OJ
    @Martin: Glad to hear that the articles has helped clarify how it works.

    Regarding your issue, it seems to me that there's something else that might be biting you in the butt. I need to clarify a couple of things first:

    1) Are you creating a debug build or release build?
    2) Are you linking to any other third party libraries?

    If you're creating a release build, this will indicate that some other library that you're linking to has a reference to the debug runtimes. If that's the case then you'll have to get that library rebuilt so that it either links to the release version of the CRT or statically links. This might be an issue even if you're creating debug builds. Just be wary of what you link into your project as you might get some stragglers with it.

    Statically linking libraries should remove the need for the associated DLL, so there has to be some libary that you're including which dynamically links to the debug CRT.

    I hope that points you in the right direction. You shouldn't ever have to manually modify the manifest. If it has things in there that shouldn't be, then it indicates that there's a problem with your build.

    Good luck, let us know how you go :)
    OJ
  • Martin
    Hi all,


    Thanks for the article. I finally understood these side-by-side problems. I am playing with an app developed on VS2008. I link *statically* to the C runtime libraries. Why, on Earth, I still have embedded manifest with a dependency name='Microsoft.VC90.DebugCRT' version='9.0.21022.8'? How can I modify the content of the manifest? Any help will be highly appreciated.


    Martin
  • OJ
    Hey all, I just added a footnote to the post regarding a tool which will make this process a little easier. Check it out!
  • OJ
    @Bobo: Thank you for your comment. I'm glad you find the site useful and have been given a bit of hope! Sorry for taking so long to respond. The Christmas period has been pretty busy for me, and the time I've had to get online I've spent doing other things.

    So you're trying to use AVG on XP sp2, and you're getting the dreaded "application configuration" error message. Given that you've said you've got the latest version of the AVG installer, perhaps they've now made the mistake again. My guess is that last time they moved from Visual Studio 2003 to 2005, they didn't update their installers with the VC runtimes that are required with 2005 builds. Perhaps lately they've finally updated their environments to 2008, and hence need to do the same again? They might even have service pack issues for their runtimes. Who knows? :)

    I haven't checked out the forums of late to see if AVG are aware of the issue, but I'm guessing not.

    Have you attempted to see which files are missing on your system? Have you managed to determine, via the method above, which folder the application is looking for in WinSxS?

    I'm going to take a stab in the dark and recommend you install the latest VC++ runtimes, for both 2005 and 2008. Download them from Microsoft.com and install them both. See if that fixes your problem. You can get them here:

    <ul>
    <li>VC++ 2005 runtimes</li>
    <li>VC++ 2008 runtimes</li>
    </ul>
    Both of those links are for the 32-bit versions. If you are still having issues, then perhaps it's time to ditch AVG? I personally am not a fan of the software, and given that they have so many issues with their installers I don't think they deserve to have you as a user. If you're looking for a high quality personal antivirus solution, I recommend using Avast. You have to register, but it's free for personal use (you don't need to enter credit card details or anything, just an email address). It's a great piece of software, and in the past has picked up viruses on machines that AVG has failed to find.

    I hope that helps! Good luck and happy new year ;)
  • Bobo
    Btw..i'm Running xp sp2..i apologize for not entering that in my last post
  • Bobo
    I know a little about computers thru trial and error, but upon seeing OJ suggest different things that could be possible for the "This applicaiton has failed to start because the application configuration is incorrect"...btw i had uninstalled AVG due to it not updating no matter whati did..so upon reinstalling, i got the error mentioned above.  Now i notice Oj said avg had resolved the issue with their installers and this was dated in july..I tried downloading the newest installers last night.(now December) and still getting same error...I tip my hat to you OJ for ur knowhow..this site is closest i've been to an answer and u gave me hope..i want to wait and see if u answer me before attempting again, i really like avg as i can not afford to pay for an AV program...Will the above link u gave us self install and if i have the file..will it overwrite or prompt me....Thank you again and i wish u the merriest of the holidays
  • OJ
    @oras: Are you running Vista? If so, you need to make sure you run the install as an administrator, even if you're an admin yourself.
  • oras
    hi there i have this problem with my adobe after effect cs3 any way i install all links Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)
    but still dont get that file u called x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91
    pls help ^^
  • Brady
    Please Please Help ME...

    I know computers fairly well, however I am new to 64 bit.
    For some strange reason my Vista 64 started giving me sideby side errors.
    Every single 32 bit app (Program files(x86)) apps give me the error, while any 64 bit apps dont.
    Trolling for a few hours I found the most common solution to be installing vcredist_x86  This file wont install it gives me the same error.
    So I downloaded vcredist_x64, but this file is built with a 32 bit self extractor and results with the same error.  I Tried uninstalling the Visual Studio 05 but it gives me a windows installer can not be accessed.

    I have tried using a restore point, I have tried sfc /f and it failed.

    Is there some trigger that can enable windows 32 bit installs to work and I can install vcredist_x86?  Thanks.
  • OJ
    Hi Jin,

    Thanks for your comment! I am happy that you found the site useful and that you've managed to resolve your problem. Thanks for the link! All the best :)
  • Jin
    OJ -

    I have been struggling with this problem for the last week, just wanted to say that your solution worked like a charm.  For anyone else who stumbles across this site:

    1) Download the Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) - http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en

    (sorry - don't know HTML)

    2) Install as Administrator - right click the file and "Run as Administrator"

    Thanks again OJ and everyone else who was helpful on this problem,
blog comments powered by Disqus