Re: Circular reference



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 the
references, 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


.



Relevant Pages

  • [PATCH] ftrace: mcount_addr defined but not used
    ... * to get it confused by reading a reference in the code as we ... * are parsing on objcopy output of text. ...
    (Linux-Kernel)
  • Determining if a cell has an external reference ...
    ... Is there a way to determine whether a range (cell) has an external ... \Spreadsheets\Sheet1'!$E$1) without parsing the Formula ... values for various data sources, and if parsing is needed, is there a ... range has an external reference. ...
    (microsoft.public.excel.programming)
  • Re: Need RegExp
    ... > I need a way of parsing a variable format. ... > with a Reference keyword and ends with a Comments keyword. ...
    (comp.lang.perl.misc)
  • Re: Need some help with VS .NET 2003 Templates
    ... but I still need to know how to add reference to an interface project? ... I looked at old project's *.csproj files and saw that it writes ... reference to the interface project as some KEY. ... EXAMPLE: {ASD14 ...
    (microsoft.public.vsnet.general)

Loading