dotnet / project-system

The .NET Project System for Visual Studio
MIT License
968 stars 386 forks source link

Adding a Collection Association on a Class Diagram shows an error #3003

Closed davkean closed 6 years ago

davkean commented 6 years ago
  1. Create a new Console App (.NET Core)
  2. Right-click project -> Add -> New Item -> Class Diagram
  3. Add a new source file with the following contents:
    internal interface IVsHierarchy
    {
        string[] Foo { get; }
    }
  1. From solution explorer, drag the file onto the class diagram
  2. Right-click on Foo property in the class diagram and choose "Show as Collection Association"

Expected: For the property to show an collection association Actual:

---------------------------
Microsoft Visual Studio
---------------------------
This is not a valid type name.
---------------------------
OK   Help   
---------------------------
davkean commented 6 years ago

Looks like under the covers this is occurring because the diagram thinks we're a VB class diagram, probably related to: https://github.com/dotnet/project-system/issues/2999

wjfamilia commented 6 years ago

Following your other #256 thread I was able to get the Class Designer working in my .NET Core 2.0 solution by modifying the Microsoft.CSharp.DesignTime.targets file as suggested, but the "Show as Collection Association" is a vital feature to create a clean class diagram. I hope a fix can be found, and I appreciate the effort so far.

yesitspeter commented 6 years ago

I am having this same issue. It persists in VS 15.5.5. I am using a .Net Standard library C# project with some very basic POCOs. The class diagram tool does not function properly when creating relationships.

jagmagh commented 6 years ago

Having the exact same issue as well. Unable to visualize any collection associations - which is one of the most common associations between classes - does make this a bit of a show stopper in terms of using the Class diagramming tool. Any workarounds, anyone?

Pilchie commented 6 years ago

See also :link: https://developercommunity.visualstudio.com/content/problem/229341/adding-generic-interfaces-to-class-diagrams-in-net.html, which is another scenario with the same error message.

SakuraIsayeki commented 6 years ago

I would like to request a status update on this one. Has a workaround been found / fix rolled out ? I came across this problem alongside #2999, thinking they might be related.

Pilchie commented 6 years ago

Not yet :(

davkean commented 6 years ago

Microsofties, I've an internal PR for this here: https://devdiv.visualstudio.com/DevDiv/_git/CPS/pullrequest/122409?_a=files.

davkean commented 6 years ago

I've confirmed with the above PR applied, this now works:

image

This bug has the same underlying cause as https://github.com/dotnet/project-system/issues/2999 and hence going to dup it against it.

davkean commented 6 years ago

This exactly issue will be fixed in 15.8 Preview 3, however, make note there's still one issue that we're aware of which is called out here: https://github.com/dotnet/project-system/issues/2999#issuecomment-389762981.