开发者

Cannot create class diagram for simple dll class in Visual Studio 2010

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 e开发者_C百科nsure 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.


I was facing the same issue for specific classes. The class which is private doesnot get imported in the class diagram. Update the class to public access specifier and this should work. Kedar

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜