Visual Studio 2010 gives you a solution for this problem. They've introduced a feature called Dynamic View. As long as your project is using the .NET 4.0 framework you can now inspect these elements.
Let's take a look at this code:
This code is creating a Visual Studio instance and instructing the debugger to break execution right after the creation so that we can inspect the __ComObject.
There are two ways of doing this:
- adding "vsObj" to the watch window and expanding "Dynamic View" node
- adding "vsObj, dynamic" to the watch window
Also note that if your object contains other __COMObjects you can inspect them in the same way as show here in the "AddIns" property.
This "Dynamic View" feature was developed mainly to inspect dynamic objects (another new feature from .NET 4.0). That's where its name comes from.
Sem comentários:
Enviar um comentário