Visual Studio Class Diagram not showing relationships

When I define my class properties with out using fields (which was enabled with C# 3.0), class diagram is not showing my one to one/many relationships. Inheritance is visible in the diagram though..

Is there a way to fix this?


Solution 1:

When you right click on the field or property you can select show as association or show as collection association.

Solution 2:

It's for people like me who do not find where is the menu item in 1 minute.enter image description here

Solution 3:

In Visual Studio 2013: right click the class, click Add, and select the desired relationship.

enter image description here

More information: http://msdn.microsoft.com/en-us/library/ff657806.aspx

Solution 4:

This combines with Visual Studio and does everything you want to do with Class diagrams. http://modeling.codeplex.com/

Solution 5:

Since someone asked how to download files from old codeplex.com, I will briefly explain the steps below.

  1. Access the link. In this case it is http://modeling.codeplex.com/.
  2. Click "download archive" button to download the archive.
  3. Open the downloaded zip file. ex) modeling.zip File structure in the archive file
  4. Navigate to "releases" folder if you are after the binary not the source.
  5. Open the releaseList.json file to see the description and the actual name of each file. Detailed info for each file
  6. Find the one you want and get the folder Id, file Id and FileName from the releaseList.json.
  7. Navigate to the folder matching the folder Id. ex) 2
  8. Select the file matching the file Id and copy to some other place. Rename the file with FileName from the releaseList.json.
  9. You can go from there.