How to: Retrieve the reference information of the application's current execution code

xiaoxiao2021-03-05  28

How to: Retrieve the reference information of the application's current execution code

Author: water like smoke (http://blog.9cbs.net/lzmtw)

Date:

2005-4-17

Shared sub getreferenceInfomations ()

Dim a as system.reflection. [Assembly.assembly.getexecutingassembly.getexecutingassembly.Reflection.Assembly

For Each R as System.reflection.AssemblyName in A.getReferenceDassembly

Dim ra as system.reflection. [Assembly.assembly.Load (r.Fullname)

Console.writeline ("Reference Name: {0}, reference DLL: {1}", R.Name, Ra.Location

NEXT

End Sub

The NET application adopts the cache mechanism for the reference to the assembly provided by the system, I don't understand this mechanism, I can only take a look at reading.

The result of the above code in my local machine is like this (my system is installed in I disk, Windows2003Server):

Quote Name: Microsoft.VisualBasic, reference DLL: i: /windows/assemblease/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll

Quote Name: Tracelog, reference DLL: i: / program design / Test/SolutionLog/TestruntimeTypeHandle/bin/tracelog.dll

Quote Name: System, reference DLL: i: /windows/assemblying/gac/system/1.0.5000.0__b77a5c561934e089/system.dll

Quote Name: System.data, reference DLL: i: /windows/assemblying/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll

Quote Name: System.xml, reference DLL: i: /windows/assemblying/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll

Note that there is no, it is not a reference to the DLL in i: /windows/microsoft.net/framework/v1.1.4322. For the user, it is to find the address where the user DLL is located. With a command provided by NET (I forgot), you can put the user's DLL in i: / windows / askEMBLY / under, and the program is automatically reached to this directory.

You can also find that in the general case, you can use the resource manager to find the i: / windows / askEMBLY / GAC or the following subfolder (I originally estimated that the configuration in the Folder.htt file, Ha, Windows 2003 already Cancel this file), I don't know that the system of non-Windows2003 can be seen. But this document does exist, you will i: /windows/assemblying/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll

Copy the paste to the address bar and then enter the car, you can "download" this file. Or you run cmd.exe into DOS, you can DIR out of these folders and files.

The folder GAC has a special meaning, which means that the cache type of System.xml.dll is "GAC", this information you can find through "Microsoft .NET Framework 1.1 Configuration". I: /Windows/assembly/gac/system.xml/1.0.5000.0__b

77A

The significance of 5c561934e089 / system.xml.dll is:

GAC, cache type system.xml, program set name 1.0.5000.0, version number B

77A

5C561934E089, public key mark

There is also necessary to go deep into the future. If you have added or modified supplements, then it is good.

转载请注明原文地址:https://www.9cbs.com/read-34929.html

New Post(0)