• Stars
    star
    180
  • Rank 212,007 (Top 5 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Roslyn-based cross-platform tool that generates an object model diagram from a set of C# source files or assemblies

.NET Object Model Diagram Generator

A cross-platform Roslyn-based tool that generates an object model diagram of a set of C# source files and/or .NET assemblies

Sponsoring

If you like this library and use it a lot, consider sponsoring me. Anything helps and encourages me to keep going.

See here for details: https://github.com/sponsors/dotMorten

Install

Run the following command from commandline (requires .NET Core 2.1 installed):

dotnet tool install --global dotMorten.OmdGenerator

Usage:

generateomd /source=[source folder] /compareSource=[oldSourceFolder] /preprocessors=[defines] /format=[html|image] /showPrivate /showInternal

Required parameters:
  source            Specifies the folder of source files to include for the object model.
                    Separate with ; for multiple folders
or
  assemblies        Specifies a set of assemblies to include for the object model.
                    Separate with ; for multiple assemblies, or use wildcards
				
Optional parameters:
  compareSource     Specifies a folder of old source to compare and generate a diff model
                    This can be useful for finding API changes or compare branches
  compareAssemblies Specifies a set of old assemblies to compare and generate a adiff model.
                    Separate with; for multiple assemblies, or use wildcards
  format            Format to generate: 
                       'html' a single html output (html is default)
                       'md' for markdown you can copy-paste to for instance GitHub.
		       Specify multiple with a semicolon seperator, and use an output filename without extension
  preprocessors     Define a set of preprocessors values. Use ; to separate multiple
  exclude           Defines one or more strings that can't be part of the path Ie '*/Samples/*;*/UnitTests/*'
                    (use forward slash for folder separators)
  regexfilter       Defines a regular expression for filtering on full file names in the source
  showPrivate       Show private members (default is false)
  showInternal      Show internal members (default is false)
  output            Filename to write the output to (extension is optional, but exclude the extension if you specify multiple formats)

NuGet

As an alternative you can also reference a NuGet package to your class library, and set up a post-build script to generate an Object Model Diagram HTML file:

Install-Package dotMorten.OmdGenerator 

Add the following to your project:

  <Target Name="GenerateObjectModel" AfterTargets="Compile">
    <Exec Command="dotnet &quot;$(DotNetOMDGeneratorToolPath)&quot; /source=&quot;@(Compile)&quot; /preprocessors=&quot;$(DefineConstants)&quot; /output=&quot;$(OutputPath)$(TargetName)&quot;" WorkingDirectory="$(ProjectDir)" />
  </Target>
 

An example of a generated output for all of .NET Core can be found here.

It can also be used to compare two folders (for instance two separate branches) and only show changes to the API. Here's an example of .NET CoreFX v2.0 vs Master.

Screenshot

Examples

Generate OMD for .NET Core FX source code, and ignore ref and test folders:

generateomd /source=c:\github\dotnet\corefx\src /exclude="*/ref/*;*/tests/*;*/perftests/*"

Compare .NET CoreFX Master with v2.0.0 repo branches directly from their Github zipped downloads:

generateomd /source=https://github.com/dotnet/corefx/archive/master.zip /compareSource=https://github.com/dotnet/corefx/archive/release/2.0.0.zip /exclude="*/ref/*;*/tests/*;*/perftests/*"

What's new in Xamarin.Forms? Compare assemblies from the nuget cache:

generateomd /assemblies=%USERPROFILE%\.nuget\packages\xamarin.forms\3.3.0.912540\lib\netstandard2.0\*.dll /compareAsssemblies=%USERPROFILE%\.nuget\packages\xamarin.forms\3.2.0.871581\lib\netstandard2.0\*.dll

More Repositories

1

WinUIEx

WinUI Extensions
C#
472
star
2

NmeaParser

Library for handling NMEA message in Windows Desktop, Store, Phone, Universal, and Xamarin (Android + iOS), coming from files, bluetooth, serial port or any stream
C#
246
star
3

WindowsStateTriggers

A collection of custom visual state triggers
C#
243
star
4

UniversalWPF

A set of WPF Controls ported from Windows Universal
C#
238
star
5

MauiEx

A set of .NET MAUI controls
C#
181
star
6

Microsoft.SqlServer.Types

a .NET Standard implementation of the spatial types in `Microsoft.SqlServer.Types`
C#
73
star
7

LifxNet

A .NET library for controlling LIFX light bulbs
C#
72
star
8

Microsoft.Azure.Kinect.BodyTracking

A .NET Standard wrapper around the Azure Kinect BodyTracking SDK
C#
26
star
9

AllJoynClientLib

An Universal Windows apps (UWP) Device Client Library for various common AllJoyn devices
C#
21
star
10

SharpGIS.GZipWebClient

GZip WebClient for Windows Phone
C#
19
star
11

ProjNET

A .NET library that performs coordinate conversions between various geodetic coordinate systems for use in fx. Geographic Information Systems (GIS) or GPS applications.
C#
19
star
12

AllJoynDotNet

A .NET wrapper for the AllJoyn C Library (.NET, UWP, Xamarin)
C#
15
star
13

IoTivityDotNet

A .NET Wrapper around the IoTivity C SDK
C#
14
star
14

MSTestX

An MSTest-based TestRunner for cross-plat use (Xamarin Android and iOS)
C#
14
star
15

AllPlayMediaPlayer

An AllPlay Media Player Server service implementation for the Windows Universal Platform. Make your Raspberry PI your new remote controlled music player!
C++
14
star
16

UnifiClient

A .NET Library for the Ubiquity Unifi REST and Websocket APIs
C#
13
star
17

System.Device

Port of .NET Framework's System.Device APIs to .NET Core
C#
12
star
18

AllJoynPhilipsHueDSB

AllJoyn Device Service Bridge for Philips Hue
C++
11
star
19

ARCore.Xamarin

ARCore Xamarin samples
10
star
20

MatterNet

.NET Client library for controller Matter devices (formerly known as Project Chip)
C#
10
star
21

NetStandardProjectTests

C#
9
star
22

GpsStatusDisplay

GPS Status Display for Arduino NMEA reader
C++
9
star
23

LocationHelper

A .NET Standard multi-targeted Location Services API for handling location updates across multiple platforms
C#
9
star
24

ArcGISRuntimeDesktop

An ArcGIS Runtime WinUI 3 Desktop sample app
C#
8
star
25

GeometryConversions

Provides conversion between ArcGIS Runtime Geometry and other Geometry data objects
C#
7
star
26

XamlResourceViewer

A simple application that allows you to browse default XAML Resources, Styles and Templates
C#
7
star
27

Windows.Devices.Sensors

Sensor API for .NET Windows Desktop apps that matches the Windows Store and WIndows Phone APIs
C#
7
star
28

AllJoynDeviceSimulator

A Windows 10 app that mocks AllJoyn devices for testing your AllJoyn apps
C++
6
star
29

AlljoynDSB

An AllJoyn Device System Bridge based on Microsofts but improved for greater control over interfaces and easier development
C++
5
star
30

XmlDocStripTask

Optimizes your xml documentation for intellisense by stripping out internal documentation and remarks.
C#
5
star
31

ZigbeeNet

Portable Class Library for Zigbee. Supports .NET, Windows Store and Windows Phone.
C#
4
star
32

SharpGIS.HttpClient.WP

HttpClient for Windows Phone
C#
4
star
33

WPFBenchmarkTests

Comparing WPF performance on .NET Core vs .NET Framework
C#
4
star
34

RTXBoxController

A WinRT component for using the XBox Controller in Windows Store Apps - Supports C++, C#, VB.NET and JavaScript
C#
4
star
35

Xamarin.AzureSpatialAnchors

Xamarin bindings for Azure Spatial Anchors API
C#
4
star
36

NtlmAndroid

Example of adding NTLM support to Xamarin Android
C#
3
star
37

ArcGIS-DotNet-Routing-Sample

Sample app that shows how to write a turn-by-turn routing application using the ArcGIS Runtime SDK for Windows Store apps.
C#
3
star
38

AllJoynLightingController

A WIndows Universal App implementation of the AllJoyn Lighting Service Framework Controller
C++
3
star
39

RoslynApiRenamer

A solution for doing mass-renames of types and members in a C# project
C#
3
star
40

OpenSprinklerNet

.NET Library for querying and controlling your 'OpenSprinkler'
C#
3
star
41

MauiPlayground

C#
2
star
42

AntiGrainRT

Anti-Grain Geometry for Windows Store and Windows Phone (WinRT)
C
2
star
43

XamlTypeInfoBuildTask

Build task that fixes the autogenerated 'XamlTypeInfo' build warnings
C#
2
star
44

StreamDeckCalendar

Shows the next calendar item from Windows Mail & Calendar app in your stream deck
CSS
1
star
45

NullabilityStats

Commandline tool that gives an estimate per-folder how many lines of code hasn't been nullability annotated
C#
1
star
46

AllJoynEcobeeDSB

An AllJoyn DSB for the Ecobee Thermostats
C#
1
star
47

ExtensionSDKSample

Sample project showing how to create an Extension SDK from a WIndows Universal Control Llibrary
C#
1
star
48

dotMorten.github.io

CSS
1
star
49

Esri.ArcGISRuntime.Xamarin.Forms.WPF

An example of how the Esri ArcGIS Runtime for WPF can be wrapped in a Xamarin.Forms renderer
C#
1
star
50

devhomenugetextension

1
star