It seems that there is a really annoying issue in Class Diagram designer in VS (my version is 2010 Ultimate, release, but the issue is also observed in VS 2008).
When I'm trying to create a class diagram for particular simple class from DLL I'm getting the following error: "Some of the selected type(s) cannot be added to the class diagram. Check the code for errors and ensure that all required assemblies ... blah-blah-blah". I cannot find the root cause for the issue and I cannot distinguish what characteristics of classes influence on that error (it can actually build a class diagram for some classes, but not for all).
My code doesn't contain any error. I have multiple class and interface definitions in one separate .cs file, but these classes are really simple - even no calls to unmanaged/interop.
Any solution for this?
Probably it is not root of your problems but check if these classes that won't show in diagrams are not partial and if you don't have any other class defined before this partial class in the same file. For example code like this prevents forms from proper showing in designer in Visual Studio 2010:
class AAA
{
//this class prevents BBB form from showing in designer
}
partial class BBB : Form
{
}
If you move declaration of AAA after BBB everything is ok, error occurs only in order showed above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With