How to locate a file in Solution Explorer in Visual Studio 2010?

前端 未结 13 1288
盖世英雄少女心
盖世英雄少女心 2020-12-07 07:09

I have a huge solution with multiple projects. Sometime I need to navigate to a file in Solution Explorer. Using the VS 2010 \'Navigate To\

相关标签:
13条回答
  • 2020-12-07 08:06

    For Visual Studio 2017 using a French AZERTY keyboard the command is the same as stated by Aaron Carlson but the keyboard shortcut is different.

    The AZERTY keyboard shortcut to navigate to the active file for c# is Ctrl+),Ctrl+S

    I checked the shortcut hadn't changed for QWERTY users in VS2017 on this page http://visualstudioshortcuts.com/2017/

    0 讨论(0)
  • 2020-12-07 08:08

    There's an option to track the active (open and viewed) item in the solution explorer. If the file is in view, the file in the solution explorer will be selected.

    Tools->Options->Projects and Solutions->Track Active Item in Solution Explorer

    0 讨论(0)
  • 2020-12-07 08:08

    If you have ReSharper and want to add "Locate in Solution Explorer" to the tab's context menu:

    1. Go to Tools -> Customize -> Commands -> Context Menu
    2. Select "Other Context Menus | Easy MDI Document Window".
    3. Click "Add Command".
    4. Choose "Resharper" -> "ReSharper_LocateInSolutionOrAssemblyExplorer" (in VS2019, the category name was changed to "Extensions")
    5. "OK" -> "Close"

    Now, when right click on any tab and you'll see a new option: Locate in Solution Explorer.

    UPDATE:

    Following the comment from @jeremy-paskali, you can set a keyboard shortcut for this command:

    1. Go to Tools -> Customize -> "Keyboard..."
    2. Search for "ReSharper.ReSharper_LocateInSolutionOrAssemblyExplorer" in the "Show commands containing" field and select it.
    3. Review the currently assigned shortcuts in the drop down below.
    4. Make any changes, if needed.
    5. "OK" -> "Close"
    0 讨论(0)
  • 2020-12-07 08:08

    This is actually built in to visual studio without the need for ReSharper (which I love BTW).

    http://blogs.msdn.com/b/zainnab/archive/2010/03/29/track-active-item-in-solution-explorer-vstipproj0011.aspx

    0 讨论(0)
  • 2020-12-07 08:11

    VS2012 added a new command called SolutionExplorer.SyncWithActiveDocument. The default shortcut for c# is Ctrl+[,S

    This command will navigate to the active file in the Solution Explorer.

    Also, it seems that you need to have the "Track Active Item in Solution Explorer" option turned off.

    0 讨论(0)
  • 2020-12-07 08:12

    In the event you want to only track the current file through a keyboard shortcut - the activity is "View.TrackActivityinSolutionExplorer" (assign keys here -> Tools - Options - Environment - Keyboard)

    Credit (James' comment)

    This worked for me

    0 讨论(0)
提交回复
热议问题