Class Diagrams in VS 2017

前端 未结 10 1011
长情又很酷
长情又很酷 2020-12-04 08:10

I have been using VS 2015 and like the Class Diagram item. I recently upgraded to 2017 and can\'t seem to find the Class Diagram item. Anyone know how I get to it?

相关标签:
10条回答
  • I am using VS 2017 Enterprise, you can find an option to install the class diagram extension using he Quick Launch in VS.

    0 讨论(0)
  • 2020-12-04 08:42

    VS 2017 Professional edition- Go to Quick launch type "Class..." select Class designer and install it.

    Once installed go to Add New Items search "Class Diagram" and you are ready to go.

    0 讨论(0)
  • 2020-12-04 08:46

    Woo-hoo! It works with some hack!

    According to this comment you need to:

    1. Manually edit Microsoft.CSharp.DesignTime.targets located in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\Managed (for VS Community edition, modify path for other editions), append ClassDesigner value to ProjectCapability (right pane):

    2. Restart VS.

    3. Manually create text file, say MyClasses.cd with following content: <?xml version="1.0" encoding="utf-8"?> <ClassDiagram MajorVersion="1" MinorVersion="1"> <Font Name="Segoe UI" Size="9" /> </ClassDiagram>

    Bingo. Now you may open this file in VS. You will see error message "Object reference not set to an instance of object" once after VS starts, but diagram works.

    Checked on VS 2017 Community Edition, v15.3.0 with .NETCore 2.0 app/project:

    GitHub issue expected to fix in v15.5

    0 讨论(0)
  • 2020-12-04 08:49

    You need to install “Visual Studio extension development” workload and “Class Designer” optional component from the Visual Studio 2017 Installer to get the feature.

    See: Visual Studio Community 2017 component directory

    But this kind of item is not available on all project types. Just try for yourself:

    • In a Console App (.NET Framework) is available;

    • In a Console App (.NET Core) is not available.

    I couldn't find more info on future availability also for .NET Core projects.

    0 讨论(0)
提交回复
热议问题