"vivekian" wrote...
Just wondering is there a simple way to extract the names of all the
assemblies placed in your bin folder ?
Maybe something like this, feed it with a DirectoryInfor corresponding to
your folder...
....
using System.Reflection;
using System.IO;
....
private ArrayList LoadAssemblies(DirectoryInfo d)
{
ArrayList assemblyNames = new ArrayList();
if (!d.Exists) return assemblies;
FileInfo[] ff = d.GetFiles("*.dll");
int assemblies = ff.Length;
foreach (FileInfo f in ff )
{
string name = LoadAssembly( f );
if ( name != null )
{
assemblyNames.Add(name);
}
}
}
private bool LoadAssembly(FileInfo f)
{
string name = null;
try
{
Assembly a = Assembly.LoadFrom(f.FullName);
name = a.FullName;
}
catch (Exception ex) // Ignore non-loadable dll:s
{
return null;
}
return name;
}
--------------------------------------------
// Bjorn A