Feb 272014
 

What does Side by Side Mean?

Side by Side implementation allows binaries co-exist side by side even with identical names. Well internally the binaries are placed into different folders based on type, name, version, processorArchitecture and publickeytoken. All these elements make up a unique folder/file name. For developers all they need is to embed a manifest into their application which I guess most of you would know. Mostly side by side dependencies are specified via #pragma comment statements or Visual Studio creates a manifest file which is then embedded into the binary using mt.exe. Visual Studio creates a manifest file in the intermediate output folder which follows the following naming convention.

AppOutputFileName.exe.embed.manifest

How is a manifest embedded into an application?

If you build your application then you should see following line in the build output window…

1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>Embedding manifest...

This file will be embedded into the binary as a resource of type RT_MANIFEST which is just an XML file. The OS application loader will pick up this file from the application’s resource section and will figure out application dependencies from the manifest entries.

Viewing Manifest file embedded into an executable file

Viewing Manifest file embedded into an executable file

What does Side by Side Solve?

The intention was to solve dll hell but this itself went on to become a bigger hell making bloggers like me to blog on this issue. Side by Side errors are hard to figure out hence there is a dedicated tool to help figure the errors out. Side by Side concept is cool but got screwed by the numerous ifs and buts that got into this technology.

How does a Side by Side error look like?

Side by side errors are troublesome to troubleshoot. You run an MFC/CRT application on customer machine and you run into error dialogs similar to the one shown below…

image

Don’t get overawed by the error. Its quite easy to troubleshoot, hmm well.

How to troubleshoot Side by Side errors using sxstrace?

As the error message suggests let use sxstrace.exe. The usage of sxstrace is pretty easy to understand…

C:\windows\system32>sxstrace
WinSxs Tracing Utility.
Usage: SxsTrace [Options]
Options:
   Trace -logfile:FileName [-nostop]
       Enabling tracing for sxs.
       Tracing log is saved to FileName.
       If -nostop is specified, will not prompt to stop tracing.
   Parse -logfile:FileName -outfile:ParsedFile  [-filter:AppName]
       Translate the raw trace file into a human readable format and save the re
sult to ParsedFile.
       Use -filter option to filter the output.
   Stoptrace
       Stop the trace if it is not stopped before.
Example:  SxsTrace Trace -logfile:SxsTrace.etl
          SxsTrace Parse -logfile:SxsTrace.etl -outfile:SxsTrace.txt
Collecting sxstrace logs

The command usage message shows us two sample commands and that’s exactly what we’re going to try. Please make sure you’re running an elevated command prompt…

Run the following command…

C:\>SxsTrace Trace -logfile:SxsTrace.etl
Tracing started. Trace will be saved to file SxsTrace.etl.
Press Enter to stop tracing...

So now you’re in tracing mode. Go ahead and run your application which threw the side by side error. Press enter on the command prompt window once you’re done repro’ing the error, this will stop the side by side tracing that’s going on. Once you press enter the ETL trace file will be dumped into the current folder. The dumped trace file is not in human readable format…

Binary output from SxsTrace tool

Binary output from SxsTrace tool

Parsing sxstrace logs

To make it readable, we’ll need to parse this file using sxstrace tool. Run following command to do that…

C:\>SxsTrace Parse -logfile:SxsTrace.etl -outfile:SxsTrace.txt
Parsing log file SxsTrace.etl...
Parsing finished! Output saved to file SxsTrace.txt.

So now we have a text file as output. Lets open the file and find out what went wrong… Contents are as follows…

Parsed output from sxstrace

Parsed output from sxstrace

I’ve annotated the above screenshot for your convenience.

Sample location of a side by side assembly

So basically side by side works based on version of a dll. All side by side binaries go in the winsxs folder located in C:\Windows. For e.g. on my machine msvcr90d.dll is located in the following folder…

Viewing a side by side assembly

Viewing a side by side assembly

If you noticed, the folder name is made up of version number as well. So dll’s belonging to different versions are put in unique folders hence they exists “side by side” hence the name “side by side”.

So the above error means the application couldn’t find msvcr90d.dll in the above location. The way I would solve this is to create a setup project in VC9 and install the merge modules onto the target machine. Please note the dll’s are debug binaries else you could have just installed the redist’s.

Hope this will help you.

  34 Responses to “Troubleshooting side by side issues using sxstrace”

  1. awesome tutorial, thanks!

  2. Facing same error.
    Not able to run any .exe .
    I have download Redistributable but not able to install .

    Not able to do anything .

    Please help.

  3. Hi, I have got a similar error but when I try to Run in trace mode SxsTrace Trace -logfile:SxsTrace.etl I get a messa ge as folows in the command prompt:StartTrace Failed. Error Message is:
    Access denied.

  4. I tried leave a reply but got an ‘invalid security’ error message.

  5. love this – solved my issue
    Thank you very much

  6. Small, dialog-based vc++ 2005, MFC project creates a manifest for

    However, there is no version 8.0.50608.0 in the winsxs folder — all 8 CRT files have 8.0.50727.xxxx, where xxxx is a number between 47 and 6229. Yet, the application runs! I got this assignment because it doesn’t run on the target machine, so I can’t test possible fixes on my machine.

    Where does VC++ get which version to use? Everything I have read in the last two days indicates that I need to install the 2005 CRT Redistributable, but I cannot select a version of the redist to download. How can I get the specific version of the DLLs the app needs?

  7. Igot an error starttrace failed.Error message is :Unknown Error

  8. Hi Nibu,

    Thanks for this great article; it helped me to understand better how to use sxstrace and what are the key parts in the log that gets generated. Unfortunately, I am still having the “SidebySide” issue with my server (Windows Server 2008 R2). We have SQL Server 2008 installed on it and it was working properly until a reboot. We thought that the issue was caused by a set of Windows security updates but even after uninstalling the updates and rebooting the server, I still have the same issue. I have also tried to re-install the Microsoft Visual C++ 2008 Redistributable (we have the version 9.0.31729.6161 for both x86 and x64; we also have the version 9.0.30728.4148 for x86). This is what got logged with sxstrace:

    =================
    Begin Activation Context Generation.
    Input Parameter:
    Flags = 0
    ProcessorArchitecture = Wow32
    CultureFallBacks = en-US;en
    ManifestPath = C:\Program Files (x86)\Microsoft SQL Server\90\Shared\sqlbrowser.exe
    AssemblyDirectory = C:\Program Files (x86)\Microsoft SQL Server\90\Shared\
    Application Config File =
    —————–
    INFO: Parsing Manifest File C:\Program Files (x86)\Microsoft SQL Server\90\Shared\sqlbrowser.exe.
    INFO: Manifest Definition Identity is (null).
    INFO: Reference: Microsoft.VC80.CRT,processorArchitecture=”x86″,publicKeyToken=”1fc8b3b9a1e18e3b”,type=”win32″,version=”8.0.50727.4027″
    INFO: Resolving reference Microsoft.VC80.CRT,processorArchitecture=”x86″,publicKeyToken=”1fc8b3b9a1e18e3b”,type=”win32″,version=”8.0.50727.4027″.
    INFO: Resolving reference for ProcessorArchitecture WOW64.
    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.VC80.CRT\8.0.50727.4027__1fc8b3b9a1e18e3b\Microsoft.VC80.CRT.DLL.
    INFO: Did not find manifest for culture Neutral.
    INFO: End assembly probing.
    INFO: Resolving reference for ProcessorArchitecture x86.
    INFO: Resolving reference for culture Neutral.
    INFO: Applying Binding Policy.
    INFO: Find publisher policy at C:\Windows\WinSxS\manifests\x86_policy.8.0.microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_none_516e2e610f48bda6.manifest
    INFO: Publisher Policy redirected assembly version.
    INFO: Post policy assembly identity is Microsoft.VC80.CRT,processorArchitecture=”x86″,publicKeyToken=”1fc8b3b9a1e18e3b”,type=”win32″,version=”8.0.50727.4053″.
    INFO: Begin assembly probing.
    INFO: Did not find the assembly in WinSxS.
    INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC80.CRT\8.0.50727.4053__1fc8b3b9a1e18e3b\Microsoft.VC80.CRT.DLL.
    INFO: Attempt to probe manifest at C:\Program Files (x86)\Microsoft SQL Server\90\Shared\Microsoft.VC80.CRT.DLL.
    INFO: Attempt to probe manifest at C:\Program Files (x86)\Microsoft SQL Server\90\Shared\Microsoft.VC80.CRT.MANIFEST.
    INFO: Attempt to probe manifest at C:\Program Files (x86)\Microsoft SQL Server\90\Shared\Microsoft.VC80.CRT\Microsoft.VC80.CRT.DLL.
    INFO: Attempt to probe manifest at C:\Program Files (x86)\Microsoft SQL Server\90\Shared\Microsoft.VC80.CRT\Microsoft.VC80.CRT.MANIFEST.
    INFO: Did not find manifest for culture Neutral.
    INFO: End assembly probing.
    ERROR: Cannot resolve reference Microsoft.VC80.CRT,processorArchitecture=”x86″,publicKeyToken=”1fc8b3b9a1e18e3b”,type=”win32″,version=”8.0.50727.4027″.
    ERROR: Activation Context generation failed.
    End Activation Context Generation.

    • The error is:
      ERROR: Cannot resolve reference Microsoft.VC80.CRT,processorArchitecture=”x86″,publicKeyToken=”1fc8b3b9a1e18e3b”,type=”win32″,version=”8.0.50727.4027″

      Looks like you need to install VC8 redist (VS2005). From what I could find this redist looks to be coming as a part of this SQL update…

      https://support.microsoft.com/en-us/kb/981355/

      Let me know if this doesn’t solve your problem.

  9. Hi Nibu,
    I will appreciate if you can help me with this error:
    “Log Name: Application
    Source: SideBySide
    Date: 3/12/2015 2:15:41 AM
    Event ID: 33
    Task Category: None
    Level: Error
    Keywords: Classic
    User: N/A
    Computer: Catamaran1
    Description:
    Activation context generation failed for “C:\WINDOWS\WinSxS\x86_microsoft.vc80.mfc_1fc8b3b9a1e18e3b_8.0.50727.762_none_0c178a139ee2a7ed\MFC80.DLL”. Dependent Assembly Microsoft.VC80.MFCLOC,processorArchitecture=”x86″,publicKeyToken=”1fc8b3b9a1e18e3b”,type=”win32″,version=”8.0.50608.0″ could not be found. Please use sxstrace.exe for detailed diagnosis.
    Event Xml:

    33
    2
    0
    0x80000000000000

    2084
    Application
    Catamaran1

    Microsoft.VC80.MFCLOC,processorArchitecture=”x86″,publicKeyToken=”1fc8b3b9a1e18e3b”,type=”win32″,version=”8.0.50608.0″

    C:\WINDOWS\WinSxS\x86_microsoft.vc80.mfc_1fc8b3b9a1e18e3b_8.0.50727.762_none_0c178a139ee2a7ed\MFC80.DLL

  10. Hi Nibu,

    I wonder if you would be so kind as to help me with my sidebyside problem. The event error id 33 has been hounding me since the day I bought my HP with pre-installed Windows 8 (64bit).

    The error is as follows:

    “Activation context generation failed for “C:\Program Files\CyberLink\PhotoDirector5\Kernel\CES\CES_AudioCacheAgent.exe.Manifest”. Dependent Assembly PDR.X,type=”win32″,version=”1.0.0.0″ could not be found. Please use sxstrace.exe for detailed diagnosis.”

    I’ve asked for help in the photodirector 5 forum but no luck.Perhaps I’ll have better luck here.

    I’ve done an sxstrace and I’ve parsed the result. The SxsTrace.txt mentions the following error:

    “INFO: Resolving reference PDR.X,type=”win32″,version=”1.0.0.0″.
    INFO: Resolving reference for ProcessorArchitecture PDR.X,type=”win32″,version=”1.0.0.0″.
    INFO: Resolving reference for culture Neutral.
    INFO: Applying Binding Policy.
    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:\Program Files\CyberLink\PhotoDirector5\Kernel\CES\PDR.X.DLL.
    INFO: Attempt to probe manifest at C:\Program Files\CyberLink\PhotoDirector5\Kernel\CES\PDR.X.MANIFEST.
    INFO: Attempt to probe manifest at C:\Program Files\CyberLink\PhotoDirector5\Kernel\CES\PDR.X\PDR.X.DLL.
    INFO: Attempt to probe manifest at C:\Program Files\CyberLink\PhotoDirector5\Kernel\CES\PDR.X\PDR.X.MANIFEST.
    INFO: Did not find manifest for culture Neutral.
    INFO: End assembly probing.
    ERROR: Cannot resolve reference PDR.X,type=”win32″,version=”1.0.0.0″.
    ERROR: Activation Context generation failed.
    End Activation Context Generation.”

    ——————————————————–

    This is only a section of the whole report which described the error. The whole report (SxsTrace.txt) is quite long and I’m not sure if it’s alright or necessary to reproduce the whole report here. Please let me know. Your help would be much appreciated.

    • Hi Larry,

      No worries. Lets try figuring this out.

      The error says>>> PDR.X,type=”win32″,version=”1.0.0.0″

      This library is missing. Can you search your machine for this library or dll? If its present please move it to a known location like, application folder or system32 folder.

      Thanks,
      Nibu

      • Hi Nibu,

        There’s no PDR.X.DLL in my desktop. There is a PDR.X.MANIFEST file located in the powerdirector’s directory but the sidebyside error is in the photodirector5 software. Both applications are from Cyberlink.

        I thought of appending the whole SxsTrace.txt below as it might give you more info that will help you to pinpoint the source of the sidebyside error. However, when I hit the “Post Comment” button nothing happens. I suspect there’s a cap on the size of posts. Unfortunately I don’t see a way to include it as an attachment. Anyway, if you don’t mind I’m sending you the dropbox link to the SxsTrace.txt file as follows:

        https://www.dropbox.com/s/uu7whlw352nwb79/SxsTrace.txt?dl=0

        By the way, I’ve also googled for PDR.X.DLL hoping that I could download it but no luck.

        Thank you so much for your help.

        • Larry,

          Search your entire machine not just desktop. If this dll is missing then from what I know so far there is no way out of this error. You’ll need this dll since the application is dependent on this dll.

          Sincerely,
          Nibu

          • Hi Nibu,

            Sorry, I used the wrong word. When I said desktop, I actually meant my “entire machine”. Anyway, this is really a strange problem. I’ve uninstalled and reinstalled photodirector5 several times and the pdr.x.dll is still missing.

            And it isn’t available from the internet for downloading. Furthermore, even Cyberlink seems to have no solution for this sidebyside problem. I guess I’ll just get rid of this photodirector5 as it came preinstalled with my Windows 8.1 and didn’t cost me a cent.

            Anyway, thanks a lot for time and trouble.

            Regards,

            Larry

      • Hello Nibu,

        I’m been trying to post a question for a couple of days now, but I keep getting an ‘invalid security token’ message when I post a reply with the text of a sxs tracelog included. Please, can you suggest why this is happening?

  11. Hi i would like to know how can i solve this side by side configuration error? Please help me thanks

  12. completely managed to screw up the filename of the proposed ‘copied’ folder. It should have read:

    ‘x86.microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_88e41e092fab0294’

    Apologies.

    • Hi Rhys,

      Don’t worry!
      Please don’t make changes to the sxs folder. Its not designed for manual modification. You’ll most probably need to intall the following redistributable.

      http://support.microsoft.com/kb/2538242

      I’ll try to get the direct download link for you but give me time until I get to office.

      Thanks,
      Nibu Thomas

    • I decided to give it a try (thinking I could always delete the copied folder if it didn’t work but didn’t realise that even administrator doesn’t have permissions to put things in the ‘c:\windows\winsxs’ folder (apparently it is only write enabled for ‘trustedinstaller’). Looks like I’m stuck unless you can give me some kind of fix 🙂

      Sorry to be posting so many comments here but I was really hoping to get some work done with this application today and if I have to wait for support to a) open and b) reply then that goes out the window (no pun intended).

      • ^^^ Couldn’t work out how to delete this comment – you said not to make changes to the sxs folder and I haven’t. I just wasn’t sure how to get rid of this earlier post ^^^

  13. Hi, This is all a bit new to me, I’ve never had any kind of side by side error before. I ran through all the steps you described (lifesaver! thank you!) and thanks to your very clear explanation of the logfile output I eventually got to the point where I found this:

    ERROR: Cannot resolve reference Microsoft.VC80.CRT,processorArchitecture=”x86″,publicKeyToken=”1fc8b3b9a1e18e3b”,type=”win32″,version=”8.0.50727.6195″.

    I checked in ‘c:\windows\winsxs’ and there is no such folder, although I did find another folder called
    ‘amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_88e41e092fab0294’
    which contains three DLL files:
    ‘msvcm80.dll’
    ‘msvcp80.dll’
    ‘msvcr80.dll’

    Could this be the cause of the side by side error and if so what can I do to get it fixed? Is it as simple as copying the existing amd64 folder (named above) and renaming it
    ‘x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727_none_88e41e092fab0294’?

    Its a brand new program I just bought and I can’t even get it to run. Worst comes to worst I can contact support but I’m on a different timezone so it will be a while until I can get in touch with them, I thought since you had such a great article you might be able to help.

    [Also as a complete aside, for dummies such as myself, could the original post reflect that an ‘elevated command prompt’ is when you run it as administrator, it took me and extra couple of googles to work that one out after 10 minutes of wondering why the commands weren’t working properly in cmd.exe]

  14. Much better, thanks 😉

  15. How do I remove the social media bar on the left? It covers up the first two characters of every line and makes the article hard to read! Thanks.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.