I'm trying to build method that will check all dlls that are not system dlls, and download them from FTP. For example I have some devxpress DLLs referenced and newtonsoft (Json.net). Problem is when I try to get list I only get 16 of them and there are more on reference list.
List<string> moduli = new List<string>();
Assembly a = typeof(frmPostavkeDokumenata).Assembly;
Assembly assem =Assembly.GetEntryAssembly();
foreach (AssemblyName an in assem.GetReferencedAssemblies())
{
if (!an.Name.Contains("System") &&
!an.Name.Contains("mscorlib") && !an.Name.Contains("Microsoft"))
{
moduli.Add(an.Name);
}
}
This is my reference list:
Assembly.GetReferencedAssemblies
just retrieve the referenced assemblies which are used as a Type in your Assembly. So, actually it is impossible to retrieve Visual Studio references using reflection.
This is the only way to perform it that you should parse .csproj file of assembly/project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With