What is winsxs? [ZT]

Source: Internet
Author: User
(Reproduced: http://www.boxcounter.org /? Action = show & id = 91)

How to install the VC library?

A seemingly simple question. I always thought it was in the ApplicationProgramDirectory is the best, can avoid DLL hell, in fact, it is not!

This articleArticle"Why does vc8 install libraries to winsxs ?" I made a very good explanation! In the past, Microsoft also experienced many detours.(Boxcounter: This article describes some history and is strongly recommended)

In vc6, it is recommended to put it under system32 for the convenience of updates.

In vc7, considering DLL hell, it is recommended to put it under the application directory.

In vc8, it is recommended to put it under the system directory winsxs to ensure convenient updates, and use manifest to support coexistence of different versions of DLL.

At the end, it is recommended that both vc6 and vc7 be installed in the System32 directory. In the 2 K system, vc8 is also installed in the System32 directory. In a system after XP, install it in the winsxs directory. When installing the vc8 library, we recommend that you use mergemodule to install it in the winsxs directory correctly. Otherwise, copy the manifes file to the local directory.

The installation of the vc8 library is not that simple. There are many skills, and some people have written tools for it.

Bootstrapper for the VC ++ 2005 redists

However, after SP1, the problem is not that complicated, but it is better to know more.

Visual c ++ application: How to Use manifests and re-distributable assemblies?

Side by side assembly looks good, but there are also a lot of problems, except that the problem is difficult to debug.

Diagnosing sidebyside failures

All of this was unexpected. Originally, I just wanted to know what winsxs under the Windows directory was. I still did not find winsxs's official Microsoft documentation. I accidentally discovered a Microsoft tool, iexpress, which can be used to create a self-extracting program. It has been a long time to find similar free tools.

Finally, I found Microsoft's official document "isolated applications and side-by-side assemblies", which was originally a technology available when XP was launched. I used to hear that I have never thought about it. It turns out to be so knowledgeable.

This article "how to build and service isolated applications and side-by-side assemblies for Windows XP" is detailed. After reading this article, I will understand the implementation principles and development steps. The article said that. NET Framework also uses the same technology (Simplifying deployment and solving DLL hell with the. NET Framework), but it is simpler. In the past, I thought that the concept of assembly was invented by. net, but it was just invented by it!

Summary:

Benefits of using assembly

1. Different versions of a component can be loaded in the same process by side (of course, the component must be able to handle such coexistence ).

2. You can use the COM component without the registry.

How to create an assembly?

Compile a manifest file. This is the simplest private assembly. If you want to share the file, you also need to sign the file and install it in the winsxs Directory, which is a little troublesome.

Why use private assembly?

Because it is put together with the application, side by side seems meaningless. However, you can prepare for converting to share assembly in the future. In addition, you can use COM components that do not require a registry.

How to Develop a side by side assembly?

It is not easy for developers to load different versions of a DLL/assembly in the same process. You need to consider many situations. For example, avoid data exchange between Assemblies of different versions, because the structures may be inconsistent. For example, avoid using shared memory and global semaphores.

Why does the winsxs directory become larger and larger?

Some people on the Internet say that their winsxs directory has already reached a dozen g, which is too exaggerated. Some people say that they only have a dozen MB. What is this?

This is because the Assembly will not be changed after it is released. If there is a bug modification, a new version will be released and will coexist with the old version. In this way, you can maintain compatibility and install updates without restarting your computer. In short, it is very convenient. However, with the increase of time, the system and applications will be constantly upgraded, the Assembly version will become more and more, and the occupied hard disk space will naturally become larger and larger.

How to update assembly?

Sidebyside achieves version compatibility by forcibly specifying the version number of the Assembly, but how to update the Assembly in that case? If Assembly changes the version number, the application dependent on it cannot automatically enjoy updates. If the version number is not changed, the incompatibility problem of the DLL hell version will arise.

Microsoft uses publisherconfiguration to solve this problem. You can force all (or specified) old versions to be automatically transferred to the new version. At this time, with the release of the new version assembly, a publisherconfiguration is released to force the version number jump (redirect ). In this way, the new version of assembly can be used without re-packaging and deployment of published applications. Of course, the new version of assembly must be backward compatible. Publisherconfiguration is a global jump. You can also perform different jumps for different applications, that is, applicationconfiguration. Both configurations change the binding relationship between their assemblies without changing the existing applications, and are suitable for centralized policy-based management. Application configuration can override the publisherconfiuration setting and enforce dependency on a specific assembly version to ensure compatibility-This makes it possible to miss important Assembly updates.

It is a dilemma to maintain the isolation between different assemblies and to automatically update them. There is no perfect solution at all. Publisher configuration and application configuration only provide a balanced solution.

Summary
In a complex and constantly evolving system, component version management is a big problem. How to gradually evolve without changing existing applications is a major challenge.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.