Generate sequence diagram fails with VS2010 - Object reference not set to an instance of an object
Every time I try to generate a seqeuence diagram I get that "Object reference not set to an instance of an object" from Visual Stud开发者_StackOverflowio 2010.
I searched google, found some people also posting this error but no straight answer. Also, most people didn't have this bug all the time, while I always get it. Even on a clean new project.
Any ideas?
I was able to get past this error by changing the way my method signature was written before trying to generate the sequence diagram.
when I was getting the error it was written as such: ClassName1 IInterfaceName.SubmitData(string username, string password, string data)
I changed it to: public ClassName1 SubmitData(string username, string password, string data)
and it let me generate the diagram
perhaps this is something to do with interfaces and explicitly stating that the method is public?
HTH!
This topic has information about this issue:
A blank sequence diagram is generated after the following message is displayed:
"Object reference not set to an instance of an object."
This issue occurs when a sequence diagram is generated from an explicit implementation of an interface method, and the diagram is not added to the source project automatically. > An explicit implementation precedes the method name with the interface name and a period (.).
For example, this issue occurs when you generate a sequence diagram from the following signature and do not add the sequence diagram to the project automatically:
void ILinkedWorkItemExtension.OnWorkItemCreated() {}
Sequence diagram can not reverse all methods !! Sometimes the method nature or other instances makes it impossible.
精彩评论