I can't even get close to the dreaded red X with this model. VS crashes just trying to paint it. Unfortunately, this tracks to a .NET bug with the System.Windows.Forms.LinkLabel class (more specifically the SetMeasurableCharacterRanges GDI+ API, which has an artificial upper limit). Making it even worse is that it waits until the paint to crash (as opposed to where the Text or Visible properties are set), so it is somewhat hard to catch.
This is triggered by drawing the LinkLabel in the DiagramSpy window. The LinkLabel is the list of diagram names that displays when no diagram is selected. Apparently, once you get enough diagrams with sufficiently long names (I'm conjecturing on the name length), the LinkLabel just can't handle it anymore. This occurs when:
-
A document is first activated, or is reactivated (switching between two ORM documents will activate/reactivate), and the Diagram Spy window is visible.
-
You show the Diagram Spy window using the Tool Windows submenu and it is currently showing no diagram
-
You select the Diagram Spy tab
-
You delete the diagram currently showing in the spy window and the window is visible
It does not occur if you show the window with a 'Select in Diagram Spy' command from the model browser or another diagram. So, to avoid the bug, hide the diagram spy window before deactivating your document, reopen it using a 'Select in Diagram Spy' command, and close it before closing VS.
Has anyone else seen this, or is it just Steve with his 56 diagram model?
-Matt
PS Steve, with this many diagrams, you might want to use the 'Diagram Management' extension to better manage your diagrams.
PPS I have a 10 line hack fix for this (overrides LinkLabel.OnPaint, catches the overflow, and clears the links), but I don't have time to do anything more about it today.