reading manifest

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ahmet AKGUN

    reading manifest


    Hi;

    Can we get all dependincy information (manifest) of an executableusing c# ?
    If so, can anybody give a small example ?

    thanks..


  • Kevin McNeish [C# MVP]

    #2
    Re: reading manifest

    [color=blue]
    > Can we get all dependincy information (manifest) of an executableusing c#[/color]
    ?[color=blue]
    > If so, can anybody give a small example ?[/color]

    You can, by means of the Assembly class's GetReferencedAs semblies method.
    For example:

    Assembly MyAssembly = Assembly.LoadFr om("c:\\MyAssem bly.dll");
    AssemblyName[] AsmNames = Assembly.GetRef erencedAssembli es();

    You can also get a reference to the currently executing assembly like this:

    Assembly CurrentAssembly = Assembly.GetExe cutingAssembly( );

    Regards,
    Kevin McNeish
    C# MVP
    Chief Software Architect, Mere Mortals .NET Framework



    Comment

    • Ahmet AKGUN

      #3
      Re: reading manifest


      thanks it workes, but how can I dismiss System.Forms like dependincies ?
      I just want to external referenced dll's that users prepared and their
      version

      But all System.* referances are also in this list.

      thanks..



      "Kevin McNeish [C# MVP]" <kevinm@oakleaf sd.com> wrote in message
      news:O2N2dPzaDH A.2016@TK2MSFTN GP10.phx.gbl...[color=blue]
      >[color=green]
      > > Can we get all dependincy information (manifest) of an executableusing[/color][/color]
      c#[color=blue]
      > ?[color=green]
      > > If so, can anybody give a small example ?[/color]
      >
      > You can, by means of the Assembly class's GetReferencedAs semblies method.
      > For example:
      >
      > Assembly MyAssembly = Assembly.LoadFr om("c:\\MyAssem bly.dll");
      > AssemblyName[] AsmNames = Assembly.GetRef erencedAssembli es();
      >
      > You can also get a reference to the currently executing assembly like[/color]
      this:[color=blue]
      >
      > Assembly CurrentAssembly = Assembly.GetExe cutingAssembly( );
      >
      > Regards,
      > Kevin McNeish
      > C# MVP
      > Chief Software Architect, Mere Mortals .NET Framework
      > www.oakleafsd.com
      >
      >[/color]


      Comment

      Working...