How to find mscorlib.dll program?

I installed a third-party program on my computer. I opened one of the DLLs that came with this program in ildasm.exe, and checked the manifest:

.assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 2:0:0:0 } 

Thus, the program uses either .net 2.0, 3.0, or 3.5.

I searched mscorlib.dll on my computer and found 61 files.

How to find which of these .dll programs are actually using?

I also notice that a group of them is located in directories with the name: C: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework.NETPortable \ v4.0 \ Profile \ ProfileXXX \ mscorlib.dll, where XXX is 1-3 is a digit number.

What's going on here? I could understand that each version of .net (2.0, 3.0, 3.5 ...) would have a different file, but should not contain up to 61 files. What is the difference between each of these profiles?

This is what the .net solution for DLL.net looks like. A number of versions of the same file + public keys for the safe definition of .dll.

Who removes DLLs that are no longer in use? Each program seems to have its own .net version. Should replenish the disk in the end?

+5
source share
1 answer

You just discovered a simple fact: .NET was very popular, and after 13 years there are many. Most programmers are aware of versions 1.0, 1.1, 2.0, and 4.0 for the desktop version. And it is always prescribed by NGEN, therefore it is multiplied by 2. Most of them do not know that mscorlib.dll contains unmanaged code, therefore there are two different versions: one for 32-bit and one for 64-bit code, multiplied by 2 again.

It is just for the desktop. Then you have versions designed for different runtime environments. There are Silverlight, 5 different versions. Windows Phone, 4 versions. Windows Store, 2 versions. And XBox. They matter because you can create programs that work with these goals.

Then there are portable class libraries, they allow you to choose the set of goals that you want to support. Each permutation of options has its own separate reference assembly, so you cannot accidentally use a type that will not be available on one of the targets.

So, the real surprise is that you have found so little.

Keep in mind that the vast majority that you found are only reference assemblies. They simply contain metadata, without code, present in the c: \ Program Files (x86) \ Reference Assemblies directory. You use them only when creating your program. At runtime, "real" is used, it is very different from the one you built with. It is the burden of Microsoft to make sure that they are consistent, and you will not have a problem, they are very good at it.

There is nothing special in what you indicated. It requests the version v2.0 used in the .NET Framework version 2.0 - 3.5. Even if you do not have one of these versions installed on your desktop, you can still run it if you have 4.0, 4.5 or 4.6. The CLR desktop automatically translates requests for 2.0.0.0 to version 4.0.0.0, it is very compatible.

+7
source

All Articles