Condividi tramite


Find code with Architecture Explorer

To find specific code, use Architecture Explorer in Visual Studio Ultimate to browse:

  • Visual C# .NET, Visual Basic .NET, Visual C++, or X++ projects

  • Projects that share code across multiple apps

  • Compiled code, like assemblies, executables, and binaries

To browse code that's shared across multiple apps or X++ code, make sure that you have Visual Studio 2013 Update 2 or later. If a type has the same name and is shared by multiple app projects in a solution, then that type appears multiple times in Architecture Explorer.

To see relationships in the code that you found, create code maps or dependency graphs from Architecture Explorer. See Map dependencies across your code on dependency graphs.

  • Get started with Architecture Explorer

  • Find source code in a Visual Studio solution

  • Find compiled code in assemblies, executables, or binaries

  • Refine your results

  • Refresh your results

Get started with Architecture Explorer

Open Architecture Explorer

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

    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 your 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 your 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.

    Another 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 assemblies, executables, or binaries

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 results

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

  • Filter results in the current column by name

  • Filter results in the current column by category or property

  • Filter results in the next column by category

  • Filter results in the next column by link type

  • Group results by container or property value

Filter results in the current column by name

Filter the current column by name

  1. In Architecture Explorer, at the top of the 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 results in the current column by category or property

Filter the current column by category or property

  1. In Architecture Explorer, at the top of the 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 items of a specific category, under Categories, click the types that you want.

  4. To show only those items 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 items. The lower-right corner of the column displays a watermark to show that the column is filtered.

Filter results in the next column by category

  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 results 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 results

To see changes that were made to the code or solution, refresh Architecture Explorer manually.

  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

Map dependencies across your code on dependency graphs

Visualize code