Find Code with Architecture Explorer

In Visual Studio Ultimate, you can use Architecture Explorer to help you explore and find source code in Visual C# .NET, Visual Basic .NET, and Visual C++ projects, and compiled code such as assembly files, executable files, and binary files. You can also create dependency graphs from Architecture Explorer. See Visualize Code Dependencies on Dependency Graphs.

In This Topic

  • Introducing Architecture Explorer

  • Find source code in a Visual Studio solution.

  • Find compiled code in managed assembly or executable files.

  • Refine your browsing results.

  • Refresh your browsing results.

Introducing Architecture Explorer

To open Architecture Explorer

  • On the Architecture menu, point to Windows, and then click Architecture Explorer.

    To resize Architecture Explorer, drag the top of the window to the height that you want. To move ArchitectureExplorer, drag its title bar, or tab, to the position that you want.

    Tip

    If any windows appear above Architecture Explorer, such as the Error List window or the Output window, move those windows so that they do not prevent you from resizing Architecture Explorer.

Top-level domains in Architecture Explorer

Architecture Explorer: Domains, views, nodes, node types, and link types

Architecture Explorer represents structures as nodes and relationships as links. As you browse, Architecture Explorer displays nodes in successive columns. The first column shows the domains and views that you can browse. When you select a domain and a view, Architecture Explorer shows you the available nodes in that view.

When you select nodes in a column, the next column in Architecture Explorer shows you nodes that are logically related to your current selection. For example, if you select namespaces, you will see types in the next column. If you select types, you will see members in the next column. The collapsed action column that appears along the right side of a node column identifies the default types or relationships of the nodes that the next column contains. You can filter the results of the next column by expanding the action column and selecting specific types of nodes or links.

Tip

The action column is highlighted when you move the pointer over it.

Find Source Code in a Visual Studio Solution

You can use Class View or Solution View in Architecture Explorer to browse source code down to the level of expressions.

  • Class View shows you a logical view of a Visual Studio solution. For example, you can browse by namespace, classes, members, and so on.

    Class View in Architecture Explorer

  • Solution View shows you physical view of a Visual Studio solution. For example, you can browse by project, project files, and so on.

    Solution View in Architecture Explorer

To find code in your solution

  1. In the first column of Architecture Explorer, under Visual Studio <solution name>, click Class View or Solution View.

    A node column appears to the right of the first column. This column shows all the nodes that are available in the selected view. For example, if you selected Class View, you see all the namespaces that logically exist in your solution.

  2. In the node column, select a node or multiple nodes to see the next column of related nodes. To select all the nodes in the current column, press CTRL+A.

  3. Repeat step 2 until you find the nodes that you want.

    Tip

    To restart your query by clearing the columns, on the Architecture Explorer tool bar, click Clear ColumnsClear Columns button.

Find Compiled Code in Assembly, Executable, or Binary Files

Use Select Files in Architecture Explorer to browse managed assemblies down to the level of method-to-method calls.

  1. On the Architecture menu, point to Windows, and then click Architecture Explorer.

  2. In the first column, under File System, click Select Files.

  3. In the Open dialog box, browse to the assemblies or binaries, select them, and then click Open.

    A node column appears and shows the selected files.

  4. In the node column, select a file or multiple files.

    Another node column appears and shows all the nodes in the selected files.

  5. Select a node or multiple nodes to see the next column of related nodes. To select all the nodes in the current column, press CTRL+A.

  6. Repeat step 4 and step 5 until you find the nodes that you want.

Refine Your Browsing Results

You can refine the results of your browsing session in the following ways:

  • Filter nodes in the current column by name.

  • Filter nodes in the current column by node type or property.

  • Filter nodes in the next column by node type.

  • Filter nodes in the next column by link type.

  • Group nodes by container or property value

Filter Nodes in the Current Column By Name

Filter the current column by name

  1. In Architecture Explorer, at the top of the node column, click the shaded area to show the filter box.

  2. Type the name, and then press ENTER.

    The current column shows only the matching nodes. The lower-right corner of the column displays a watermark to show that the column is filtered.

Filter Nodes in the Current Column By Node Type or Property

Filter the current column by category or property

  1. In Architecture Explorer, at the top of the node column, click the shaded area to show the filter box.

  2. To the left of the filter box, click the Filter items in the current column by category or property button.

  3. To show only those nodes of a specific type, under Categories, click the types that you want.

  4. To show only those nodes with specific properties, under Properties, click the properties that you want.

  5. When you are finished, click OK.

    The current column shows only the matching nodes. The lower-right corner of the column displays a watermark to show that the column is filtered.

Filter Nodes in the Next Column By Node Type

  1. In Architecture Explorer, browse to the node column that comes before the nodes that you want to see, and then select the nodes that you want.

  2. On the right side of the node column, click the collapsed action column to expand it.

    Tip

    The action column is highlighted when you move the pointer over it.

  3. In the action column, under Node Navigation, select the specific types of nodes that you want to see next. To see a union of these types, select multiple types.

    A node column appears and shows any matching nodes.

    Note

    When you browse .NET code, you might see the following types that apply only to C and C++ code and will not show results if you select them: Unions, Typedefs, and Members.

Architecture Explorer organizes the link types that are used to filter the next set of nodes into two categories: inbound or outbound. These categories describe the direction of the link relative to the currently selected node. An outbound link points from the currently selected node to the next related node. An inbound link points from the previous related node to the currently selected node. When you select an outbound link type, Architecture Explorer shows you the next level of related nodes. When you select an inbound link type, Architecture Explorer shows you the previous level of related nodes.

For example, if you select a class node, and you select the outbound Contains link type, Architecture Explorer shows you the nodes that the class node contains. If you select the inbound Contained By link type for that class node, you see nodes that contain that class, such as namespaces, class files, and projects.

  1. In Architecture Explorer, browse to the node column that comes before the nodes that you want to see, and then select the nodes that you want.

  2. On the right side of the node column, click the collapsed action column to expand it.

    Note

    The action column appears highlighted when you move the pointer over it.

  3. In the action column, select one of the following:

    • To see related nodes at the next level, under Outbound Navigation, select the link types that you want.

    • To see related nodes at the previous level, under Inbound Navigation, select the link types that you want.

      Note

      To see a union of these types, select multiple types.

    The next column appears and shows any matching nodes.

Group Nodes by Container or Property Value

In Architecture Explorer, you can create groups of nodes based on either their existing containment relationships or their property values. If grouping is possible, a list of new group nodes will appear when you complete this task.

When you create a graph from these groups in Architecture Explorer, you can use the Show All as Groups command to organize linked nodes into groups. For more information, see the following topics:

You can also use groups to organize nodes on an existing graph. For more information, see Edit and Customize Dependency Graphs.

  1. In Architecture Explorer, browse to the node column that contains the nodes that you want to group. To select all the items in the column, press CTRL+A.

  2. On the right side of the node column, click the collapsed action column to expand it.

    Note

    The action column appears highlighted when you move the pointer over it.

  3. In the action column, under Grouping:

    Click

    Then

    Group by Containers to see any available groups

    • To see nodes that are in these groups, select some groups.

      The next column shows the nodes that are in the selected groups.

    Group by Properties to see any available properties

    1. Select the properties that you want to use as groups.

      The next column shows groups organized by property value.

    2. To see nodes that have specific property values, select some property value groups.

    The number and kinds of groups that you see are based on the types of the property values:

    • Boolean values: True and False

    • Integer values: Four groups that divide the range of values into even quartiles.

    • String values: A group appears for each unique string value, and nodes belong to each group based on their particular property value.

      This is most useful when the selected property has the same string value across multiple nodes. For example, if you select a property has a unique string value for each node, then you will get one group per node.

Refresh Your Browsing Results

You must refresh Architecture Explorer manually to show any changes that are made to the code or solution.

To refresh Architecture Explorer

  1. In Architecture Explorer, browse to the node column that comes before the column that you want to refresh.

  2. In the current column, select the nodes that are related to the updated nodes.

    Another node column appears to shows the refreshed list of nodes.

See Also

Concepts

Visualize Code Dependencies on Dependency Graphs

Visualizing and Understanding Code