How to locate DLL in native C ++ world/DOTNET world?

Source: Internet
Author: User
Tags dotnet

Summary:

1. For native C ++ world, dynamic-link library search order is clear. There is another question: If you create a new folder in any directory, put the DLL and dependency DLLs required by an application, such as plugin, when you load the dependency DLLs required by this plug-in (if a DLL with dependencies is loaded by specifying a full path, the system searches for the DLL's dependent DLLs as if they were loaded with just their module names .) will this new folder be searched?

2. For DOTNET world, there are two application-level files: app.exe. manifest and app.exe. config. Next, we will give a comprehensive introduction to how to locate assembly in runtime CLR. The simple version is thatGAC is searched firstly, and then the app path tree. % PATH % is never used.Basic knowledge:

1)In DOTNET world, a private assemblyIs stored in the application's directory and used by a single application.A share assemblyCan be used by multiple applications and is stored in the Global Assembly Cache, a repository of assemblies maintained by the. NET Framework.

2) The difference between GAC and sidebyside is described in detail in this blog.

3) If you do need to move the private assembly of an app (to a certain extent, but it is definitely not qualified in GAC) out of the app path, ms also provides a mechanism to help you locate the successful Assembly: assemblyresolver. For more information, see this blog assemblyresolver.

4) use assembly binding Log Viewer (fuslogvw.exe) to debug any assembly loading problems.

Reference: in what order are locations searched to load referenced DLLs?

Related Article

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.