Get Application reference assembly at runtime

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Serge calderara

    #1

    Get Application reference assembly at runtime

    Dear all,

    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.

    thanks for your answer
    regards
  • Jon Skeet

    #2
    Re: Get Application reference assembly at runtime

    Serge calderara <serge.calderar a@maillefer.net > wrote:[color=blue]
    > 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.[/color]

    Well, you can find out all the assemblies which are loaded in a
    particular AppDomain using AppDomain.GetAs semblies. 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.Assem blyLoad and log the version
    loaded when each assembly loads - but again, that wouldn't get you
    everything right at the start.

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    Working...