This is my first attempt at seriously using the Visual Studio Modelling Project type, and the Layer Diagram in particular.
I would like to use the diagram to validate (the lack of) some dependencies in my architecture. I’ve created a Layer Diagram of how I thought things should look like and used the Validate Architecture feature. It came up with several violations, most of which were known by me already.
I added the dependencies that shouldn’t be there to document the current situation: validation passed as expected.
Now I’ve created a copy of that diagram in the same project, where I intended to draw out the desired new structure. I removed the dependencies and right clicked the diagram to “Validate Architecture” again. To my surprise no violations were reported. Then I removed the dependencies in the original copy and validated my new copy again: the violations were back.
It appears, that Visual Studio uses all the layer diagrams in the project together, to come with a complete picture of the dependencies. Is my assumption correct? Is there some way to have diagrams considered seperately, without creating a second modelling project?
It appears this is how the modelling project is intended.
When validating architecture using the command line, the name of the model is not part of the syntax. Only the name of the project is provided, so it makes sense that all the diagrams are taken into account.
As a workaround, I have created a second modelling project. One contains all the diagrams of the current situation, and one contains several diagrams of how things should be.