2

I have generated my C++ project class diagram using Visual Studio 2012 CLASS DIAGRAM -> Export Diagram as Image .And I am getting the following error:

specified cast is not valid

In the web I found that VS2012 Update 1 was supposed to fix this.I am today on update 4 and I still experience this issue.How can I fix it?

To generate the diagram I did the following:

Go to "Class View" panel ,select the namespace of my classes,right click select "View Class Diagram" . Did it exactly as described here.

Community
  • 1
  • 1
Michael IV
  • 11,016
  • 12
  • 92
  • 223
  • Can you provide code for reproducing this problem? – TobiMcNamobi Oct 01 '14 at 08:28
  • There is no code here.You generate the UML via the menu bar as I described. – Michael IV Oct 01 '14 at 08:31
  • Can you describe what you have done to reproduce the issue? Maybe post the image by cut'n'pasting it here (e.g. using the print key and MSPaint)? – TobiMcNamobi Oct 01 '14 at 08:39
  • I get a class diagram by right-clicking on a cpp file ("code") or a class in the class view (code again) and choosing "View Class Diagram". How do you get a class diagram without code? Or have you tried to generate code from the diagram? What's the result? – TobiMcNamobi Oct 01 '14 at 08:46
  • Ok,working on the update. – Michael IV Oct 01 '14 at 08:51
  • I do the same for two classes `A` and `B`, `B` inheriting from `A`. Works nicely. Please provide a [reproducable example](http://stackoverflow.com/help/mcve). – TobiMcNamobi Oct 01 '14 at 09:04
  • What do you mean "works nicely"? Did you try to save to image as I explained?Did it save?What version of VS do you use? – Michael IV Oct 01 '14 at 09:07
  • VS2012 produced a png file containing the UML diagram of the two classes. – TobiMcNamobi Oct 01 '14 at 09:09
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/62238/discussion-between-michael-iv-and-tobimcnamobi). – Michael IV Oct 01 '14 at 09:11

1 Answers1

1

I got the same issue today in Visual Studio 2013 update 3.

I was able to generate an image by simply selecting all objects on the class diagram image and then hitting ctrl-c to copy. Then opened up Word and hit paste.

It generated an image correctly.

user229044
  • 232,980
  • 40
  • 330
  • 338
blorkfish
  • 21,800
  • 4
  • 33
  • 24