I am currently developing with VisualStudio 2008. I find it increasingly difficult to find files when the number of files and projects increase. The situation become so bad that I literally have to spend 10-20 seconds to find code I want to work on when switch between files. Sounds like not a lot of time, but this can be very annoying because it breaks the "coding flow".
I believe this is a general problem with all IDEs. But I still find it easier to work with Eclipse. One particular example is that in Eclipse, I could apply some key shortcut to find implementations defined in an Interface.(I have forgotten which key shortcut though, after not working with it for about 1 year.) Another example is that in VS 2008, rightclick->Find all references will find all occurrences containing the selected text(Update: This accusation is incorrect. Thanks for pointing it out); while similar operation in Eclipse will find all occurrences where the selected class/variable are referenced. Personally, I find the Eclipse way is better for file navigation.
This could be due to my inexperience with VS IDE. So, I am looking for suggestions to improve the file navigation experience so that I can get some more time for actual coding.
I have used the navigate buttons but they are only useful for small number of files.
Thanks.
I agree wholeheartedly about ReSharper. If you don't want a "paid" solution though, a useful Visual Studio shortcut is
CTRL + ,
it gives a list of recently edited files.
CodeRush is a free alternative to ReSharper which you might find useful too.
Kindness,
Dan
Have a look at Jetbrains Resharper. Ctrl N or Ctrl Shift N. To jump quickly to files by type name or by file name. Also you can control Click Classes to navigate to them instantly.
I can't even work in visual studio without it anymore. It virtually eliminates the need for the solution explorer
SamTools for Visual Studio 2005/2008 (and I have a build for 2010 if someone needs it). The particular feature that's handy here is the Solution File List.
You can right click the tab of any open document and Find In Solution Explorer or Show In Windows Explorer
You can right click in the Solution File List for the same
Unlike other solutions to this problem, this is a properly docking tool pane so it fits in great. Ctrl+Alt+F places you in the Filter box with the current text selected, so it's very easy to work with.
Oh and it's free/GPL. :)
Solution File List http://wiki.pixelminegames.com/images/8/88/SamTools_SlnFileList.png
Dpack is also a free alternative with some nice file navigation shortcuts, but Resharper is the bomb.
BTW, they should have some more of this stuff in vs2010, which is in beta right now (I think)
Related
I have Microsoft Visual C# 2010 Express edition, and every time I open it it makes a new folder in My Documents. Problem is, I want to reserve My Documents for, you know, actual documents. I managed to redirect most of the stuff in the folder into another place by changing the settings, but a folder called StartPages stays, no matter what. After some research I found I have to change something in the registry, which I can't seem to find. I researched into that and apparently I need to create a new Setup Project or something, which I also can't seem to find. I have no idea what I'm doing at the moment, so any advice would be appreciated.
(I have a bit of OCD when it comes to organizing my files the way I want, so if I can't get this to work I might go crazy). Thank you.
Go to Options in the Tools menu, select the Projects and Solutions -> General option group. The top item in that group of options should be the default project location. Change that to wherever you want your projects to go by default.
You might also need to change the other two directories in that option group.
This is based on VS2010 Pro version. If it's not there in Express, let me know and I'll have another look at it.
--
Except you've already done that. Sorry, wasn't paying attention as well as I should be.
If you can't find the registry entry to change, you could try turning off the Start Page completely. Personally I've never found it useful, so I turned it off shortly after installing VS2010.
In Tools->Options->Environment->Startup change the At startup option to Show empty environment. This disables the Start Page functionality, which also stops VS from executing the code that is creating the StartPages folder.
The registry path for Express editions is different to the Pro edition, and I don't have a VS2010 Express installed here at the moment to look at. Try searching for the value VisualStudioLocation in RegEdit, and change any value in that registry key that uses %USERPROFILE%\Documents to point to somewhere else.
I browsed through some questions and this one stood out as the better one:
.Net Classes and their source code which pointed me to this place here: Microsoft Reference Source Server.
I tried everything the site says, downloaded a file that I cannot open from there and at some point ended up with a .pdb file in my source folder for the symbol cache that I could not open with a multitude of tools I looked into.
So this is my last resort to find an answer to my question. Out of pure curiosity (and lack of a better way to understand some stuff) I want to open a particular class from Microsoft (namely I wanna look into RichTextBox and maybe the classes it inherits from) but I simply cannot find a way to make this work for me. I want the original source, not a decompiler product because, well because I mainly need to understand some stuff, not see random variable names. I appreciate any help that may get me around my stupidity and clumsiness, as well as the right tools to do so (if any other than VS).
Note that I am using Visual Studio 2012 and yes, I went over a guide covering this specific version instead of the guide on VS 2008.
The "download" links on this page: http://referencesource.microsoft.com/netframework.aspx should work. However try downloading them via Internet Explorer; my Firefox attempted to download an .aspx file instead of the installer itself for some reason. (EDIT: as #ParagMeshram pointed out, just rename the netframework.aspx to netframework.msi as a quick fix if necessary)
In addition, here's a link to the source hosted by dotnetframework.org: http://www.dotnetframework.org/default.aspx/4#0/4#0/untmp/DEVDIV_TFS/Dev10/Releases/RTMRel/wpf/src/Framework/System/Windows/Controls/RichTextBox#cs/1305600/RichTextBox#cs
I can't say for certain if it's the latest greatest, or what you would be compiling against exactly, but should give you a good idea of how it works.
I would like activity in my Visual C# 2008 Express to not appear in My Recent Documents (I use Windows XP). To clarify, when you open a solution or other file in Visual C#, a link to that solution or other file is added to "My Recent Documents". I would like that not to happen.
How can that be achieved?
I know there's a chance this question is better fit for one of SO's sister sites, but my best judgment was that it fits here...
Thanks
I know there is a away of stopping Windows from updating the list, but I don't believe there is a way to stop it from updating for certain file types.
I way you may be able to do it with is to use batch scripting.
cd "C:\Documents and Settings\PROFILE_NAME\Recent"
del *.<C# file extension or other project extensions>
...
del *.<C# file extension or other project extensions>
Create the file using Notepad and save it as <any name>.bat.
After you work with you C# project you just run this Batch script and it will remove all your evidence from your My Recent Documents folder.
NOTE: If you can't access the Recent folder (because it's hidden) try replacing Recent with My Recent Documents
Thanks
link textI've added this functionality to Visual Studio MRU editor.
The list of extensions is currently fixed, and it needs to be roughened out.
The new prelimenary executable can be downloaded here.
... and the Sources, in case you don't trust me ;)
(I'm not sure if I should keep the separate "save" handling - it was a good idea during testing, but otherwise is rather annoying).
I'm writing an add-in for Visual Studio, which must be compatible with VS 2005. This add-in involves marking certain files as "special", and I'd really like to make their specialness visually apparent in the Solution Explorer - currently my users either have to manually keep a note of which files are special, or right-click on each potentially special file and see what menu items are there.
Ideally I'd like to change the icon, but I'd be happy to (for instance) make the file's name bold or something.
Unfortunately, all the appearance-related methods seem to live on Microsoft.VisualStudio.Package.FileNode, and I only have access to UIHierarchyItems and ProjectItems. I've spent several days grovelling through MSDN, and I can't find any way of constructing a FileNode given a ProjectItem or UIHierarchyItem. There's a suggested solution on the MSDN forums, but it assumes you're starting with a FileNode, and as far as I can tell this implies creating a custom project type (and presumably some sort of project-conversion system). I don't think my users would be too happy with this.
Or is there something I'm missing?
I have inherited a large source tree, C#, Visual Studio 2008.
It has many quality issues, one of them is that the code is generally badly formatted.
I am looking for a tool, preferably a plugin for Visual Studio, that will go over the whole solution and apply the same basic formatting that Visual Studio itself applies when, for example, you close a curly brace around a block of code.
Any suggestions?
In vs2005, you can do Edit->Advanced->Format Document for a single file, which will (I believe) do what you're asking. I assume vs2008 has a similar function somewhere.
ok, so why not try a macro, if you want to do the entire solution, there is a vb example here
http://blogs.msdn.com/kevinpilchbisson/archive/2004/05/17/133371.aspx
it opens each file and applies the same formatting that VS does, but the macro will work across an entire solution (may not be that wise to run it if your solution is huge), beyond reflecting the internals of the format document code in VS and inling it into some sort of stream, this appears to be the easiest way to make use of what i consider to be a very useful feature in visual studio
ReSharper should do what you're looking for. Have a look at their Code Cleanup Feature. This can be applied to multiple files including the whole solution.
if you have already set your preferences in the vs editor options, you should be able to hit CTRL K, CTRL D which will tidy the code based upon your preferences
Here's the simple way (for me)...
I have my Visual Studio set to reformat on "Paste"
Tools | Options | Text Editor | C# | Formatting
**Automatically format on paste** (checked)
When I hit an ugly file, I do CTRL-A, CTRL-X, CTRL-V -- poof, instant format :)
Hope this helps.
Kevin