Re: Circular reference
- From: "Marc Gravell" <marc.gravell@xxxxxxxxx>
- Date: Wed, 28 Mar 2007 08:46:31 +0100
It is actually pretty easy to list the entire reference tree for an
assembly, either through reflection (if compiled) or through parsing
the csproj files (if not). I have samples of both, but they are tied
into other code that I don't want to have to remove - but you may find
this useful for pulling it apart. Note that you need to be a little
careful : the 2 core MS libs at the bottom are themselves circular, so
you need to check against that when enumerating.
Get an Assembly either from a known Type or from the startup Assembly.
From an Assembly you can use GetReferencedAssemblies() to get thereferences, which you can then attempt to load via the static
Assembly.Load method (which IIRC returns the existing Assembly if it
is already loaded) - but note that this can throw an exception if the
necessary reference isn't found.
I would probably just use the above to output the tree of your problem
assembly (where you can't add the reference), which should quickly
reveal why... no more that 20 minutes coding I'd guess.
Marc
.
- Prev by Date: RE: Ballon ToolTip
- Next by Date: Re: Circular reference
- Previous by thread: RE: Ballon ToolTip
- Next by thread: Re: Circular reference
- Index(es):
Relevant Pages
|
Loading