views:

503

answers:

1

I'd like to show a list of all used assemblies on a dedicated web page inside a ASP.NET web application for debugging and maintainance purposes (there are many instances of this web application on many different servers). The assemblies could be called from the bin folder or from the GAC. There are some written by myself, but also third-party assemblies.

Is there a simple, automated way to get a list of all loaded or referenced assemblies of the web application including the version number (calling System.Reflection.Assembly - GetName().Version ...)? Do I have to explicitly pass all assembly names for version check or could I retrieve them automatically? Do I have to use Reflection for a comprehensive list of dependencies/references?

+2  A: 

I think you can use AppDomain.CurrentDomain.GetAssemblies() for this, e.g something like this:

foreach (System.Reflection.Assembly a in AppDomain.CurrentDomain.GetAssemblies())
{
    Response.Write(a.FullName + "<br/>"); 
}
M4N
So simple... I think I just have to filter out some temporary assemblies (all the aspx / ascx converted stuff).
splattne