Structurizr for .NET

A C# implementation of the Structurizr for Java client library

The initial version of Structurizr was targeted at the Java ecosystem (see "Structurizr for Java"), for no other reason than it's what I'm most familiar with. Although this works for a good portion of the organisations that I visit when doing training/consulting, an equally sized portion use the Microsoft stack. For this reason, I've put together Structurizr for .NET, which is more or less a direct port of the Java version, with some automatically generated code from Swagger used as a starting point. It's by no means "feature complete" yet, especially since none of the component finder code (the part that extracts components automatically from a codebase) is present, but there's enough to create some basic diagrams. Here's some example code that creates a software model for the "Financial Risk System" case study that I use in my workshops.

It creates the following Context, Container and Component diagrams.

If you want to take a look or try it out, the source code can be found on GitHub and there's an initial version of the package on NuGet. Have fun!

About the author

Simon is an independent consultant specializing in software architecture, and the author of Software Architecture for Developers (a developer-friendly guide to software architecture, technical leadership and the balance with agility). He’s also the creator of the C4 software architecture model and the founder of Structurizr, which is a collection of open source and commercial tooling to help software teams visualise, document and explore their software architecture.

You can find Simon on Twitter at @simonbrown ... see simonbrown.je for information about his speaking schedule, videos from past conferences and software architecture training.



Re: Structurizr for .NET

Cool - I've had Structurizr bookmarked for a while to use on my projects, will have to check it out now.

Re: Structurizr for .NET

Pretty cool, but is there a way for auto-layout of the different views? I got a project set up, copy/pasted what you had (and updated key/secret/workspace id) and ran it. I was a little thrown off that everything just got lumped together in the corner of the diagram. And styling/icons seem to be off on the diagrams themselves, but they're correct when I click on the information button.

Re: Structurizr for .NET

At the moment, there's no auto-layout feature. Once you drag the boxes around, you can save the layout (just make sure you use the MergeWorkspace method) on the StructurizrClient to retain this layout when you update the workspace. Feel free to send me a screenshot ([email protected]) of the styling being off. Structurizr doesn't work on Microsoft Edge, but it should work on the other current browsers.

Re: Structurizr for .NET

Hi, your nuget package depends on .NET 4.5.2. Is it really necessary? Couldn't it run with .NET 4.5.0 or .NET 4.0?

Add a comment Send a TrackBack