Visual Studio (2008) - FAQs
Q: In VS2005 I could do X but I can't find that feature in
VS2008. Where is it?
Answer
A: The UI for VS2008 did not really change a lot so you should
generally be able to find all the same features in both versions. Some
features were removed or modified. If you cannot find a feature that
existed in previous versions then try looking for the command.
In VS2008, as with VS2005, all commands supported by the IDE are available via
the Tools\Options -> Keyboard menu. This option will show you all
the commands available to you and any shortcut keys they might be using.
You can use this list to search for the command. Determining the actual
command name is a little hard so you should try a simplified name. For
example if you wanted to be able to navigate between methods of a class you
should search for NextMethod or Next or even Move.
The commands are generally organized by category so you'll find edit commmands
called Edit.XYZ.
Once you have found the command you can either assign a shortcut key to it or
add a button to a toolbar or menu to represent the command. To create a
button or menu item you'll need to exit out of the options window, right-click
the toolbar area and select Customize. From there you should be
able to find the command.
Q: I need to add a lot of existing files and folders to a
project but using Add Existing Item is slow. Is there a faster way?
Answer
A: When you select a project in Solution Explorer you
might have noticed the toolbar at the top of the window changing. One of
the option (in most projects) is Show All Files. This option shows
all files and folders under the project folder whether they are in the project
or not. Files/folders not in the project are shown grayed out. If
you right-click the files/folders (multiple selection is supported) you can
right-click and select Include in Project to automatically add them to
the project. If you add a folder it will automatically include any
children in the folder. This is a great way to add a lot of items.
Q: I cannot find the Layout menu for ASP.NET pages in VS2008.
Where is it?
Answer
A: The Layout menu has been removed. It mostly
only provided two pieces of functionality. The first one was to create and
insert tables for forcing certain page layouts. The second was for
controlling absolute and relative positioning if controls.
Table layouts have been moved to the Table menu in VS2008. Unlike
VS2005 this menu only allows you to specify custom table layouts. The
predefined layouts have been removed because, in general, using tables to
control page layouts is frowned upon as it is not cross-browser compliant.
Instead you should be using CSS even though it might be harder to get use to.
As for CSS positioning this has been removed altogether because all it really
did was act as a shortcut to the Tools\Options -> HTML Designer page.
You'll see that CSS settings have changed quite a bit in VS2008. In VS2005
there was a combo box to allow you to set the various positiong options.
In VS2008 you can only choose whether to use absolute or relative. However
VS2008 also tends to prefer to generate CSS attributes for most HTML changes.
Therefore you aren't really losing any functionality as much as it is being made
more consistent. You can still set a control to absolute positioning and
then drop it where you want. As you move the control the underlying CSS
attributes will be updated.
Q: Whenever I accidentally mouse over the
Toolbox it locks up VS
for a while. What is going on?
Answer
A: This should only happen the first time you mouse over the
Toolbox after starting VS. VS is populating the window with the
controls that are defined within your solution in addition to the pre-defined
controls. This can be a slow process. To speed it up go to
Tools\Options -> Windows Form Designer\General and set
AutoToolboxPopulate to false. This will tell VS not to scan your
solution looking for controls to add to the toolbox.
Q: VS will not allow me to edit a file unless I check it
out first. How can I stop this?
Answer
A: In general this is a good thing. If it really bothers
you go to Tools\Options -> Source Control\Environment and set the On
Edit behavior to Do Nothing. This could introduce an
inconsistency in your local version vs. the version in source control so use
carefully.
Q: I migrated my VS2005 app to VS2008 but I cannot
use any of the new v3.5 features. What is going on?
Answer
A: By default when you migrate an app from VS2005 to VS2008 it
will continue to use the v2.0 runtime. To switch to a different version go to
the project properties page. Under the Application tab is the
Target Framework option where you can specify the version to use. Changing
the framework version will require that the project be unloaded and reloaded.
Additionally VS will not modify assembly references so some of your assemblies
may no longer be valid.
Q: Whenever I create a new project it wants to
use the v3.5 framework but I just want to stick with v2.0 for now. How can
I change this?
Answer
A: In the New Project dialog you'll see a little combo
in the upper right corner where you can select the framework version to use.
Set it to v2.0 or whatever framework you wish to use.
Q: I create a lot of test projects and I am getting tired of
cleaning up the temporary projects directory and clearing out the recent
projects menu. Is there some way to get VS to do this for me?
Answer
A: Yes there is. Under Tools\Options -> Projects and
Solutions there is an option called Save new projects when created.
Unchecking this option will allow you to create new projects without saving
them. It will still end up in your temporary projects folder but it will
be automatically deleted when you close the project unless you chose to save it.
Furthermore it will not be added to the MRU project list.
There are some restrictions to this option. Firstly not all project types
support it. C++ does not while C# and VB do. Secondly, you cannot
create multiple projects in a single solution without saving it first. You
also cannot do some project changes without first saving the project.
Avoid using the Save All button as this will prompt you to save the
project. However you can add files and compile and debug without saving.
Q:I heard you can debug the .NET framework in
VS2008. How can I do this?
Answer
A: While you can debug into the framework there are some
caveats. Firstly you need a hotfix to the RTM version to allow it to work.
Secondly you have to set up a source server (which you might already have).
Finally there are some restrictions. The biggest restriction is that not
all assemblies are available yet. The second restriction is that the code
is still compiled as release mode so much of the debugger will not work quite
right. For example it will be hard to look at local variable values as
they are likely to have been optimized away. It is best to use this
feature only when you absolutely must walk through the code to figure out what
is going on. In general using Reflector or equivalent tool wiill work
better in my experience. Refer to this article on how to set up VS2008 to
support debugging the framework.
Q:When I display an object in the Immediates window of VS it only shows the first 100 values. How can I show more?
Answer
A: Unfortunately the 100 limit is currently hard coded in the source and cannot be changed. The only alternative
is to use the Watch window or equivalent to view all the members.
Q:I want to use one set of assemblies during debugging and another set in release builds. How can I do this?
Answer