Skip to content
/ nbrowse Public

Playing with Roslyn's CSharpScript API to browse .NET assemblies

License

Notifications You must be signed in to change notification settings

r3c/nbrowse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NBrowse: .NET assembly query utility

Build Status License

Overview

NBrowse is a command-line utility to browse and execute search queries in .NET compiled assemblies. It exposes loaded assemblies through a standard set of traversable entities (e.g. "assembly", "project", "type", "method", etc.) and running C# statements to query anything you want to retrieve from them.

You can think of it as a stripped down NDepend equivalent with no graphical interface.

This example will search in assembly NBrowse.dll for every type that implements interface IPrinter and print them to standard output:

$ dotnet NBrowse.CLI.dll '
    project // From current project
        .Assemblies // ...pick all loaded assemblies
        .SelectMany(a => a.Types) // ...find their declared types
        .Where(t => // ...keep those implementing interface `IPrinter`
            t.Interfaces.Any(i => i.Name == "IPrinter"))' NBrowse.dll

Usage

Download latest release from GitHub or checkout code and build using your preferred .NET SDK.

Once you have a NBrowse.CLI executable file, run it with -h command line argument to display help.

$ dotnet NBrowse.CLI -h

Resource

  • Contact: v.github.com+nbrowse [at] mirari [dot] fr
  • License: license.md