Class diagrams didn't work in xproj, we need to figure out if that was based on CPS, or just based on the xproj model. We should test them.
The command for the right-click menu is VSConstants.VSStd2KCmdID.ViewInClassDiagram. Old csproj handled this by using an IViewInClassDiagram instance, which is defined in MS.VS.EnterpriseTools.Shell. This binary isn't always installed, so rather than having the project system handle this command and check so see whether the designer is installed, we should make the designer handle the command itself. Dave and I are thinking this is probably beyond the scope of RC3 though. @srivatsn, opinions?
It's already handling View In Class diagram for Class View, so I think it makes more sense to live in the class diagram code.
That seems fine - why do you think it's beyond the scope of RC3?
With the edit csproj changes and migration changes, I'm not sure I'll have time for this as well.
Ah ok. @RaulPerez1 would you be able to look into this?
@davkean where is the class diagram code? I couldn't find any reference in the project system repo so I'm presuming this is in VS?
Yeah, look at the usages of IViewInClassDiagram on index.
Even though the core class diagram code handles the command (for class view) it does nothing so I think we're going to need changes on our side one way or another.
@srivatsn I think this is going to be larger than a regular bug fix and will definitely not fit in for RC3.
@RaulPerez1 What's going on with this? Is this something you plan on completing before joining your old team?
As long as I can get it done this week yes. I'm investigating and I've found 2 additional bugs in the area so far. One's a CPS issue and the other one I'm sending out a PR today as soon as I finish testing it.
@srivatsn. Class diagrams do not currently work at all. Attempting to open one results in the following dialog:

I assume this is because class designer is still looking for C# projects based on projectypeguid instead of capabilities. @RaulPerez1 did your VSO PR get merged?
I see that https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/61185 is still active. @tannergooding can you shepherd that in?
Can do. I've pinged the original author ( @RaulPerez1 ) and the current reviewer ( @davkean ). It looks like all feedback has been addressed and it is just waiting final sign-off.
Look at my email on the topic for details, there's also a CPS bug and you'll need to add the capability to the design time targets in the project system.
Is it possible to get as ETA for when the fix for this issue will be available?
What is the current state of this? Did that PR ever get merged? I'm not seeing it in the listings here for either 15.3 or 15.6 milestones.
The PR mentioned above was for the class diagram designer which is not open source. That was merged. However there's a bug in CPS (also not open source) that still needs to be fixed before this scenario can work fully. I've just pinged that bug today.
Any update about this?
Hi guys,
Is the issue going to be resolved in the nearest future? For our team it is very important feature and the issue is preventing us from migrating to .net standard/core. Modeling project is not an option for us because it doesn't provide "two-way binding" between a diagram and actual source code.
FYI. @Pilchie. I pinged the CPS bug as well, which is still open.
FYI. @davkean
@tannergooding What's the CPS ask here?
To fix this bug https://devdiv.visualstudio.com/DevDiv/_workitems/edit/395144
@tannergooding Looks like a one line change - can we just submit the change?
If they will take it, we should be able to
The fix on our side is here: https://github.com/dotnet/project-system/pull/2817
If you build and deploy locally, you should be able to add and open class diagrams.
However, without the CPS change it may result in multiple warning dialogs popping up the first time you attempt to add the diagram to the project.
Then, manually opening the document subsequently appears to function correctly.
Thank you guys and thank you @tannergooding! I've replaced "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.CSharp.DesignTime.targets" with the file from #2817 (https://raw.githubusercontent.com/tannergooding/project-system/1ab632313f0715fced04e2f383416f3ec6695268/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/DesignTimeTargets/Microsoft.CSharp.DesignTime.targets) and it works for .net core projects!
There is a minor issue occurring every time I load the solution (https://www.screencast.com/t/q6yuSZMd8u0A) but the diagram works.
Additionally, there is another minor issue with .net standard projects (I'm not sure if it right place to report it). "Class Diagram" item is missing from "Add new item" menu for .net standard projects (e.g. <TargetFramework>netstandard1.3</TargetFramework>) https://www.screencast.com/t/xY3KM5sZ. It works if I copy existing class diagram from .net core project to .net standard project.
VS version 15.3.4.
@tannergooding We should fix/investigate that bug in the screen cast as part of this.
@Andrey-iTech Can you file a separate bug about that Add New Item? That won't block checking this in.
@davkean added #2820.
Hello, I need to add a class diagram to a .net core class library project.
I've replaced the Microsoft.CSharp.DesignTime.targets file as stated, and restarted VS.
There are no changes, it does not open a manually added class diagram.
Am I missing some other steps?
I'm using Visual Studio Community 2017.
Thank you very much.
@Univac1107, when you attempt to open the class diagram, do you get an error dialog or does attempting to open it cause nothing to occur?
The class diagram option does not appear on the new item menu.
I manually added a class diagram with this content:
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />
When double clicking it, I get the dialog:
Class diagrams are not supported for this project type.
I've used the file given on: (https://raw.githubusercontent.com/tannergooding/project-system/1ab632313f0715fced04e2f383416f3ec6695268/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/DesignTimeTargets/Microsoft.CSharp.DesignTime.targets).
Should I reinstall VS?
@Univac1107, is it a NetStandard project (#2820)?
Could you share the solution (or a simplified solution) so that I can check this out?
Here is the link to the sample app i'm using:
https://drive.google.com/file/d/0B5Cy0l7YShV2UC1aam9nT0dWNEE/view?usp=sharing
Hello, any update on this?
@Univac1107, I am able to open the class diagram successfully with the solution you supplied (sorry for the delayed response, this slipped my radar).
So I guess I'm missing something.
Beside of replacing that file, is there something else to do?
May the version of VS Community Edition matter? Should I reinstall it?
AFAIK, it shouldn't. You should just have to replace/modify your local copy of Microsoft.CSharp.DesignTime.targets with the fixes in the PR (your local copy, by default, would be under C:\Program Files (x86)\Microsoft Visual Studio\2017Community\MSBuild\Microsoft\VisualStudio\ManagedMicrosoft.CSharp.DesignTime.targets).
So it leaves it only one option, that this file:
https://raw.githubusercontent.com/tannergooding/project-system/1ab632313f0715fced04e2f383416f3ec6695268/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/DesignTimeTargets/Microsoft.CSharp.DesignTime.targets
has something wrong!
@Univac1107, double-check changes to file.
I have VS2017 Community Edition (v15.3.0), changed C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.CSharp.DesignTime.targets with this diff:

Then I restarted VS, manually create *.cd file with content:
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>
And this diagram successfully opened in VS and I can add classes to it, save, reopen VS and open diagram again. With error message (once after VS launch), but works. Woo-hoo!
Changing in the file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.CSharp.DesignTime.targets"
from:
<ProjectCapability Include="CSharp;Managed"/>
to:
<ProjectCapability Include="CSharp;Managed;ClassDesigner"/>
fixed the issue for me
This works for me, except I cannot create Collection Association links. I get "This is not a valid type name." message when I try.
This works for me, except I cannot create Collection Association links. I get "This is not a valid type name." message when I try.
Same here, actually in a .NET Framework 4.7 project that references a netstandard 2.0 class library that has the classes in it which I have on my diagram.
@tgitchel @sandord It's been about 12 years since I've used Class Diagrams, can you tell me how/what are Collection Association links are? My google foo is failing me and can't figure out how to attempt to add them.
@davkean, a collection association link will show the relationship from one class property that is a collection (array, list, etc.) of another class. If you right-click on the collection property you will see an option for "Show as Collection Association".
@tgitchel Thanks - I can repro this. It looks like the diagram thinks we're a VB project, filed: https://github.com/dotnet/project-system/issues/3003.
On top of that, there's two other bugs that we have around this:
https://github.com/dotnet/project-system/issues/2999
https://github.com/dotnet/project-system/issues/2998
@justdmitry
Based on your trick, I managed to have my netstandard 2.0 project work with class diagrams (VS 15.4.4):
I simply added this to the end of my .csproj:
<ItemGroup>
<ProjectCapability Include="CSharp;Managed;ClassDesigner" />
</ItemGroup>
and I can add/edit class diagrams in this project (nio need to restart VS as it is local to the project).
[Edited] Well, the result is not perfect as quite a few things do not work (I have (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) in the Custom Attributes property, I cannot expand most of my types...); I suppose all this is due to other bugs. This will do for now.
Are we ever gonna see official Class Designer support in .NET Core or Standard again?
Most helpful comment
Are we ever gonna see official Class Designer support in .NET Core or Standard again?