none
How can I refresh a class diagram?

    Question

  • Hi,

    I created a class diagram in Visual Studio 2015 update 3. Then I changed the visibility of a field in one of the types displayed in that class diagram, and it turned the diagram red but with the old visibility. I have tried compiling and rebuilding to no avail.

    How can I refresh that diagram?

    Regards,

    Juan Dent


    Juan Dent

    Tuesday, March 28, 2017 12:27 AM

All replies

  • Hi Juan Dent,

    Welcome to MSDN forum.

    >>Then I changed the visibility of a field in one of the types displayed in that class diagram, and it turned the diagram red but with the old visibility. I have tried compiling and rebuilding to no avail.

    Please share more detailed information about changing the visibility of a field.

    Do you mean that the class diagram is generated from your code, now added some more classes to code, but the class diagram is only showing the older classes and doesn't get updated automatically?

    The class diagrams in Visual Studio are kept in sync with the code, after that right click the project. Choose View>View Class Diagram. It will show the diagram.

    Or, please have a look at the thread : https://social.msdn.microsoft.com/Forums/vstudio/en-US/1e0d1522-eef6-4c57-84f2-b2b7fa4e1379/class-diagram-refresh-class-details?forum=vsarch which may have the same issue with you.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 29, 2017 3:14 AM
  • Hi,

    Changing the visibility of the field just means it was public and now is private... the class in the class diagram becomes red and the field keeps showing as if it were public -- no matter what I do, there is no way to synchronize the class diagram with the code.

    Opening the class in another diagram does not change things...

    Regards,

    Juan


    Juan Dent

    Friday, March 31, 2017 12:18 AM
  • Hi,

    private - Only the current class will have access to the field or method.

    public - Any class can refer to the field or call the method.

    Please refer: https://msdn.microsoft.com/en-us/library/ms173121.aspx?f=255&MSPPError=-2147217396

    The change from public to private in code will not reflect in the diagram.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 31, 2017 7:51 AM