Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show all ASP.NET web application's loaded/referenced assemblies with version numbers?

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?

like image 577
splattne Avatar asked Jan 25 '26 02:01

splattne


1 Answers

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/>"); 
}
like image 74
M4N Avatar answered Jan 27 '26 15:01

M4N



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!