Case of the Incorrect Side-by-Side Configuration

So I had downloaded the latest version of BIND DNS server for Windows from http://www.isc.org/downloads as I wanted to have an up-to-date version of DNS diagnosis tool dig to be available. However if you just tried running dig.exe by itself  (without running full install, on Win7 x64) you got the following error :

The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

image

So what’s side-by-side configuration anyway (a.k.a WinSxS or SxS)

We see from XP to Vista/Win7 a shift from INF described OS to component based descriptions. A component consists of

  • unique name based on version, language and processor architecture of component
  • one or more binaries
  • catalogue file
  • XML file describing installation
    • associated registry keys
    • associated services
    • security permissions for files
    • etc.

All the components of the Windows operating system are found in %windir%\WinSxS folder and registry key HKLM\Software\Microsoft\Windows\CurrentVersion\SideBySide. The WinSxS folder is the only location these files are found – other instances across the disk utilize hard-links back the original in the WinSxS folder.

Benefits from this system over XP include:

  • No more prompt for media when running SFC (System File Checker)
  • No more prompt for media when adding Windows features
  • New versions of whole component leave the original file as well. The new component is projected onto the whole system, but the original is left untouched. This results in:
    • Increased System Reliability
    • Uninstalling a security update can automatically result in next-highest version of component being installed
    • Removes “out-of-order” uninstall issues found in Windows XP and earlier
    • Installing optional components ensures the latest version is installed -not the “RTM” version
  • Because relationships between all components are described on system, the requirements can be responded to by the OS (i.e. during uninstall of components)

But what does this have to do with running Dig? Let’s look…

I launched Process Monitor (http://live.sysinternals.com/ProcMon.exe) and set a filter to Process Name IS dig.exe. I then launched the app

image

Ok nothing looks bad there, right? So we use SxSTrace utility, which is in-built to Windows 7. It has the following syntax

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

I launched the command with SxSTrace Trace -LogFile:SxSTrace.etl

While that was running, in another window I ran dig, it threw the error, then went back to SxSTrace and stopped the reporting.

image

I then ran SxSTrace Parse -LogFile:SxSTrace.etl -outfile:ParsedTrace to get the data into a text file

image

This gave us the following output

=================
Begin Activation Context Generation.
Input Parameter:
    Flags = 0
    ProcessorArchitecture = Wow32
    CultureFallBacks = en-US;en
    ManifestPath = C:\Users\malc\Downloads\BIND9.8.1rc1\dig.exe
    AssemblyDirectory = C:\Users\malc\Downloads\BIND9.8.1rc1\
    Application Config File =
—————–
INFO: Parsing Manifest File C:\Users\malc\Downloads\BIND9.8.1rc1\dig.exe.
    INFO: Manifest Definition Identity is (null).
    INFO: Reference: Microsoft.VC80.CRT,processorArchitecture=”x86″,publicKeyToken=”1fc8b3b9a1e18e3b”,type=”win32″,version=”8.0.50727.6195″
INFO: Resolving reference Microsoft.VC80.CRT,processorArchitecture=”x86″,publicKeyToken=”1fc8b3b9a1e18e3b”,type=”win32″,version=”8.0.50727.6195″.
    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.6195__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.4940_none_516d712b0f495a45.manifest
                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.6195__1fc8b3b9a1e18e3b\Microsoft.VC80.CRT.DLL.
                INFO: Attempt to probe manifest at C:\Users\malc\Downloads\BIND9.8.1rc1\Microsoft.VC80.CRT.DLL.
                INFO: Attempt to probe manifest at C:\Users\malc\Downloads\BIND9.8.1rc1\Microsoft.VC80.CRT.MANIFEST.
                INFO: Attempt to probe manifest at C:\Users\malc\Downloads\BIND9.8.1rc1\Microsoft.VC80.CRT\Microsoft.VC80.CRT.DLL.
                INFO: Attempt to probe manifest at C:\Users\malc\Downloads\BIND9.8.1rc1\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.6195″.
ERROR: Activation Context generation failed.
End Activation Context Generation.

OK – so we see some files not found. Why don’t these show up in the ProcMon filter we tried earlier? Let’s reset our ProcMon filter and add a filter Path Contains Microsoft.VC80

What we find is CSRSS.exe is actually trying to access the file and failing to find it…

image

This file is part of the Visual C++ 2005 Runtime from Microsoft. Looking at the extracted set of bind files we find the runtime installation here:

image

OK so I can install that to resolve the issue. That’s boring though. I want it to run from my USB disk, without installing anything…As I love my troubleshooting tools to “run anywhere”

So I extracted the redistributable using the command

vcredist_x86.exe /C /T:C:\support\vc

which extracted the files into C:\support\vc

This extracted an MSI which I extracted using command

msiexec /a vcredist.msi /qb TARGETDIR=”C:\support\vcredist”

This gives us a folder structure like this:

image

We then need to check the \Windows\WinSxS\Manifests folder. Here we see selected the manifest file that was missing via our SxS log

image

We then open this file in notepad and find it has the following contents

image

These are the three DLLs we need. We find these in the extracted folder under Windows\System32 folder

image

We simply copy these three DLLs into the same directory as dig.exe. In addition we now need to copy x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262b86.manifest into the same folder as dig.exe and rename it to Microsoft.VC80.CRT.manifest

image

The new files added:

image

Dig is now working – no install required

image

This technique is also useful for other cases when you can’t install SxS DLLs – i.e. running an app from USB key, or from within Windows PE.

Note: Typically it is better to fully install the app. This method it is possible to miss other dependencies … but is useful on occasion none the less.

About chentiangemalc

specializes in end-user computing technologies. disclaimer 1) use at your own risk. test any solution in your environment. if you do not understand the impact/consequences of what you're doing please stop, and ask advice from somebody who does. 2) views are my own at the time of posting and do not necessarily represent my current view or the view of my employer and family members/relatives. 3) over the years Microsoft/Citrix/VMWare have given me a few free shirts, pens, paper notebooks/etc. despite these gifts i will try to remain unbiased.
This entry was posted in 64-bit, Application Compatibility, ProcMon, SysInternals, Windows 7 and tagged . Bookmark the permalink.

8 Responses to Case of the Incorrect Side-by-Side Configuration

  1. dazdaztech says:

    Great post, thanks ! I am sure that this technique will come in handy again.

    Any chance of making the files available online to save some time or is there a license restriction preventing that ?

  2. harikumar says:

    I had been executing multiple vc++ applications(VS2008) from different locations under WinPE 3.1. And it is reporting “Side by Side” issue. I placed all the VC2008 redistributable extracted files under x:\windows\system32 and x:\windows\winsxs\manifests. but of no use. would please help and this would be greatly appreciated.

  3. harikumar says:

    I had been executing multiple vc++ applications(VS2008) from different locations under WinPE 3.1. And it is reporting “Side by Side” issue. I placed all the VC2008 redistributable extracted files under x:\windows\system32 and x:\windows\winsxs\manifests. but of no use. would please help and this would be greatly appreciated.

  4. Hi Chentiangemalc,
    I got the error above and tried your steps but still not succeed to run my programm. Any tips/advice/idea?
    Thanks in advance,

    Mariana
    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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s