How can I perform “Go To Definition” programmatically in Visual Studio?
问题 Given a string that represents a specific class/field/property (eg MyNameSpace.MyClass or System.String.Length ), how can I programmatically cause Visual Studio to go to that class/field/property (ie, make Visual Studio do the same thing that would happen if I was to type in the reference in the code editor and then hit F12)? 回答1: You probably need to do the following. Get the global IVsObjectManager2 interface (implemented by the SVsObjectManager object) Call IVsObjectManager2.FindLibrary to