Serge calderara <se*************@maillefer.net> wrote:
Is there a way to get the list of references attached to
my application by code?
The idea is that when my application start, I would like
to log in a file the version of all assembly used.
Well, you can find out all the assemblies which are loaded in a
particular AppDomain using AppDomain.GetAssemblies. However, if your
app only uses some of the assemblies that it references later on, those
assemblies won't have been loaded into the AppDomain.
You *could* find your executable file and read which assemblies it
references, but that would be a bit of a pain.
You could also hook into AppDomain.AssemblyLoad and log the version
loaded when each assembly loads - but again, that wouldn't get you
everything right at the start.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too