3
votes

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?

1

1 Answers

5
votes

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/>"); 
}