How to programmatically load the list of assemblies that opens in the Framework tab 
and how to load the list of assemblies that is displayed on the Extensions tab 
Well, as I understand it, the task is to find these dlls and get them, in one case, all with the System marker, and in the other Microsoft. VisualStudio, in general, these files are copied to the GAC. From there I would get them like this
static class Program { private static string WindDir = "C:\\Windows\\Microsoft.NET\\assembly\\GAC_MSIL"; private static string ExtensionSystem = "C:\\ExtensionSystem"; private static string ExtensionVS = "C:\\ExtensionVS"; static void Main() { string[] directorys = Directory.GetDirectories(WindDir); Directory.CreateDirectory("C:\\ExtensionSystem"); Directory.CreateDirectory("C:\\ExtensionVS"); GetSystemExtension(directorys, "System.", ExtensionSystem); GetSystemExtension(directorys, "Microsoft.VisualStudio", ExtensionVS); } private static void GetSystemExtension(string[] directorys, string extension, string targedFolder) { foreach(string dir in directorys) { if ((dir.Contains(extension) && !dir.Contains("ProjectSystem") && !dir.Contains("TypeSystem") && !dir.Contains("TeamSystem")) && !dir.Contains(".resources") ||( Path.GetFileName(dir) == "System")) { string[] directorySystem = Directory.GetDirectories(Path.Combine(WindDir, dir)); string[] files = Directory.GetFiles(directorySystem[0]); File.Copy(files[0], Path.Combine(targedFolder, Path.GetFileName(files[0]))); } } } } As far as I understand this is true only for the version from .Net 4.0
Source: https://ru.stackoverflow.com/questions/590690/
All Articles