How to locate a file in Solution Explorer in Visua

2019-01-20 22:14发布

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' feature I can open any file by name in Visual Studio 2010 but I want to be able to select the file in Solution Explorer as well?

13条回答
戒情不戒烟
2楼-- · 2019-01-20 22:24

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/

查看更多
对你真心纯属浪费
3楼-- · 2019-01-20 22:25

I found the track option to be a little annoying.

I prefer to use DPack. It contain "Locate In Solution Explorer" operation, plus many other features (some are less powerful in VS2010, like their browsers), and it's free.

Note that ReSharper also have the locate feature that works batter than DPack's (in some cases, DPack's locate won't work if the file is collapsed behind folders), but you don't want to buy ReSharper only for this feature.

查看更多
女痞
4楼-- · 2019-01-20 22:27

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

查看更多
爷、活的狠高调
5楼-- · 2019-01-20 22:27

Shift+Alt+L will find the current file in Solution Explorer in Visual Studio 2008+ with ReSharper installed.

查看更多
smile是对你的礼貌
6楼-- · 2019-01-20 22:30

I know its little too late, but hope it helps someone else. The best option now is to install Microsoft Visual Studio add on called - Productivity Power Tools.

http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef

With this comes "Solution Navigator" (alternative to Solution Explorer, with a lot of benefits) - which then you can use to filter the files to only show "Open". You can even filter files to show "Edited" and "Unsaved".

查看更多
叼着烟拽天下
7楼-- · 2019-01-20 22:31

In Visual Studio 2010 you can turn on the "Track Active Item in Solution Explorer" option. This will mean whenever you switch between documents the new document gets selected in Solution Explorer. This can be irritating if your solution has lots of folders, because as you move around files in your solution all the folders will be left open.

Visual Studio 2012 introduced the new "Sync with Active Document" feature. Three is a button for it at the top of Solution Explorer, or you can use the shortcut Ctrl + [, S.

screenshot of sync with active document button

查看更多
登录 后发表回答