Find the location of standard .NET assemblies?

For a small C # compiler, I need to find the paths to standard .NET assemblies, such as System.dll, System.Xml.dll and almost all assmeblies listed on the ".NET" tab in the "Add Link" section in Visual Studio (2010 ).
I would use absolute paths, but I have a feeling that this might break in exceptional cases.

+3
source share
3 answers

All of them are stored in the GAC %WINDIR%\assembly, which you can view in Windows Explorer.

Actual DLLs can be found in subfolders of folders GAC, GAC_32and GAC_MSILwhich, apparently, depend on their version. On my machine, I have three additional folders NativeImagesthat also contain the GAC'd DLL.

Windows Explorer will not allow you to browse these folders directly (as far as I can tell), but you can get there through the command line.

Full path for dll in GAC

%WINDIR%\assembly\GACFOLDER\FILENAME\VERSION__PUBLICKEYTOKEN\FILENAME.dll

eg. On my machine, different versions System.Xml.dllcan be found inC:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089 C:\WINDOWS\assembly\GAC\System.Xml\1.0.5000.0__b77a5c561934e089 C:\WINDOWS\assembly\NativeImages1_v1.1.4322\System.Xml\1.0.5000.0__b77a5c561934e089_2775eea1 C:\WINDOWS\assembly\NativeImages1_v1.1.4322\System.Xml\1.0.5000.0__b77a5c561934e089_4c5fbb92

+4
source

When compiling, you can use reference assemblies in %ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETFramework

Also see registry keys under (HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER)\SOFTWARE\Microsoft\.NETFrameworkand (HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER)\SOFTWARE\Microsoft\.NETFramework\AssemblyFoldersas described by KB306149 .

GAC is intended for use during operation.

+4
source

GAC, , . , .., .NET Framework .

" " , , . , , .NET , , . ... , % WINDIR%, , ( cd% WINDIR% , , ). .

, , , " ", MS vNext (?). / Mono ( .NET).

+1
source

All Articles