Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

dotnet-extensions v0.9.3.0, Does not work with Struturizr.Core 1.0.0 #4

Open
jeffcollaboro opened this issue Jun 3, 2021 · 6 comments

Comments

@jeffcollaboro
Copy link

Just a heads up to anyone hitting an exception :

  • {"Could not load type 'Structurizr.ModelItemView' from assembly 'Structurizr.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.":"Structurizr.ModelItemView"}

Whilst trying to write a workspace e.g.
plantUMLWriter.Write(workspace, streamWriter);

Internally this fails as the code attempts to use the RelationshipViewExtensions class to get the direction of the relationship using the GetDirection extension (SetDirection also fails). It attempts to cast the relationship view into a Structurizr.ModelItemView that has been deprecated and removed from Structurizr between v0.9.7 and v1.0.0.

Nuget is not your friend here, it defaults to the latest and greatest, and there are no version dependencies defined between the two packages.

The easy fix is to roll back to v0.9.7 (or 0.9.3) of Structurizr.Core

@kirchsth
Copy link

I fixed the build problems on my branch (The direction is stored in Position as workaround). You can test it

But the I didn't update the generated code that it works with the latest PlantUML version (I will creata a PR as soon this is finished)

BR Helmut

@kirchsth
Copy link

@jeffcollaboro: with PR #5 you should have a working version which creates correct plantuml-stdlib/C4-PlantUML v2.2.0 diagrams (not all new features are used atm)

@simonbrowndotje: Atm RelationshipView specific "DirectionValues" are stored in Position (I found no other usefull place). Can we (re)add Properties to RelationshipView that extensions are possible.

@JohnLeyva
Copy link

The issue is still present the following reproduces the issue

            var plantUmlWriter = new C4PlantUmlWriter();
            plantUmlWriter.Write(workspace, stringWriter);

@kirchsth
Copy link

Did you test it with my branch?

@JohnLeyva
Copy link

JohnLeyva commented May 17, 2022

I think with the branch actually works, but not with the latest released packages

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net60</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Structurizr.Client" Version="1.0.0" />
    <PackageReference Include="Structurizr.PlantUML" Version="0.9.3" />
  </ItemGroup>
</Project>

@simonbrowndotje
Copy link
Collaborator

With the Structurizr CLI having much better support for exporting views to PlantUML (and I appreciate it's written in Java), I'm not actively supporting the .NET exporters at this time ... I would recommend forking the repo (and creating your own Nuget package if required).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants