ArticleslgStudy

science

Side-by-side assembly

Side-by-side assembly is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Side-by-side assembly rather than just read about it. In short: Side-by-side assembly (SxS, or WinSxS on Microsoft Windows) technology is a standard for executable files in Windows 98 Second Edition, Windows 2000, and later versions of Windows that attempts to alleviate problems (collectively known as "DLL Hell") that arise from the use of dynamic-link libraries (DLLs) in Microsoft Windows. Such problems include version conflicts, missing DLLs, duplicate DLLs, and incorrect or m…

Key takeaways

  • Side-by-side assembly belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Side-by-side assembly to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Side-by-side assembly from memory before moving on to harder problems.

Reference excerpt

Side-by-side assembly (SxS, or WinSxS on Microsoft Windows) technology is a standard for executable files in Windows 98 Second Edition, Windows 2000, and later versions of Windows that attempts to alleviate problems (collectively known as "DLL Hell") that arise from the use of dynamic-link libraries (DLLs) in Microsoft Windows. Such problems include version conflicts, missing DLLs, duplicate DLLs, and incorrect or missing registration. In side-by-side, Windows stores multiple versions of a DLL in the %systemroot%\WinSxS directory, and loads them on demand. This reduces dependency problems for applications that include a side-by-side manifest. Microsoft Visual C++ 2005 and 2008 employ SxS with all C runtime libraries. However, runtime libraries in Visual C++ 2010 no longer use this technology; instead, they include the version number of a DLL in its file name, which means that different versions of one DLL will technically be completely different DLLs now. SxS is also the technological basis for registration-free COM activation. Only in-process COM servers may be activated this way.

Operation An application that employs SxS must have a manifest. Manifests are typically a section embedded in the application's executable file but may also be an external file. When the operating system loads the application and detects the presence of a manifest, the operating system DLL loader is directed to the version of the DLL corresponding to that listed in the manifest. If there is no manifest, the DLL loader loads a default version of all DLL dependencies. If the DLL is a COM server, it must have a manifest of its own for registration-free activation to succeed. On Windows Vista and later, sxstrace.exe can help to diagnose failures in the starting of applications due to SxS misconfiguration. If a user wishes to override manifest-specified assemblies (for example, in the case of security patches applied to a library), a publisher configuration file can globally redirect assemblies. Digital signatures can ensure the legitimacy of such redirection.

Manifest format The application manifest is internally represented as XML. The URN associated with SxS manifests is "urn:schemas-microsoft-com:asm.v1". Several other recent Microsoft technologies such as ClickOnce employ the same manifest format.

Example manifest The following is an example of a manifest for an application that wants newer style controls, instead of the default Windows 9x style:

Activation contexts A manifest like the one above is parsed into an activation context by the SxS loader. There is a stack of activation contexts for each thread or fiber. An API allows programmatic manipulation of these contexts. It may be necessary for a library (DLL) to change its activation context, for example if it requires a specific version of another library for its own consumption instead of using the activation context of its caller. This type of issue is sometimes called (activation context) pollution. To prevent polluting its activation context, a DLL can have a manifest embedded as a resource, which is parsed when the DLL is loaded. This manifest must be at resource id 2 in the image file for the loader to find it.

WinSxS (Windows component store)

From Vista onward, the Windows operating system uses WinSxS for its core components. Operating system files in the winsxs directory are hard linked from their usual locations in the Windows directory structure. A file in a subdirectory in winsxs may be linked from multiple locations (e.g. the System32 directory and application directories). Windows Explorer double-counts the disk space occupied by these files. This can be demonstrated using the fsutil command-line program. Some third-party Explorer extensions to show the link count also exist. However, not all files from winsxs are projected this way to "live" operating system files. For example, after installing some Windows updates, old file versions replaced by the updates are still kept in winsxs although they are no longer linked in the "live" Windows directories. This allows updates to be uninstalled safely. Because of its elevated importance, from Vista onward the winsxs directory is owned by the Trusted Installer service SID: not even the SYSTEM account can modify its contents without changing permissions. Uninstalling applications does not immediately free space in the winsxs directory; space for unused assemblies is garbage-collected over time by the Installer service. Although not officially documented, the algorithm for generating the directory names residing inside the winsxs directory has been made public on an MSDN Microsoft employee's blog. The algorithm was changed in the transition from XP to Vista. Windows 7 includes Windows AIK tool Deployment Image Servicing and Management (DISM) which can remove files used by superseded OS updates using the Trusted Installer worker service, without the need to reboot or take down the system; post-SP1 updates add Windows Update cleanup to the Disk Cleanup tool (cleanmgr.exe) and the downloadable System Update Readiness tool (CheckSUR) which can repair components store errors and replace corrupt or missing OS files with known good versions. Windows 8 integrates repair capability to the DISM tool which is now able to copy valid OS files from Windows Update or an offline WIM image, as well as reset the component store to only contain the latest versions of OS components. Windows 10 runs the automatic task to clean up the component store.

Advantages For applications that have been built with SxS, multiple applications may coexist that depend on different versions of the same DLL. This is in contrast to non-SxS DLL environments where an original DLL in a shared system folder may be overwritten by the subsequent installation of another program that depends on a different version of the same DLL. The XML formatting of the manifest is human-legible and thus makes it easier for developers to determine the dependencies of an application and their versions.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Side-by-side assembly

Start with the simplest possible case. Write down what Side-by-side assembly claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Side-by-side assembly before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Side-by-side assembly ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Side-by-side assembly

In research
Side-by-side assembly appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Side-by-side assembly in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Side-by-side assembly is common in secondary-school and first-year university syllabi. It links to neighbouring topics Windows administration, so understanding it makes those chapters shorter.
In everyday life
Look for Side-by-side assembly outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Side-by-side assembly” →

How to study Side-by-side assembly in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Side-by-side assembly means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Side-by-side assembly out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Side-by-side assembly in simple terms?

Side-by-side assembly (SxS, or WinSxS on Microsoft Windows) technology is a standard for executable files in Windows 98 Second Edition, Windows 2000, and later versions of Windows that attempts to alleviate problems (collectively known as "DLL Hell") that arise from the use of dynamic-link librarie…

Why does Side-by-side assembly matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Side-by-side assembly?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Side-by-side assembly.

Tags

  • Windows administration

Keep exploring