Tips\Tricks for Visual Studio 2005\2008

 Today we will look into some quickly accessible and useful features of Visual Studio 2005 and 2008 IDE.

1) Open Solution or Project folder in Explorer –  In Visual Studio 2008 (VS 2k8 ) you can view a project folder in explorer by right clicking the project name and finding a new option named “Open Folder in Windows Explorer” as shown below. Click on this option to open a project in Windows Explorer: 

 In both VS 2005 and 2008 we can view the containing folders but with the help of opened files in the IDE tabs. Right click the TAB of opened file and click on “Open Containing Folder” as shown below:

2) Vertical Split View in Visual Studio 2008 – In VS2k8 a new and cool feature came called slit view. Split view gives a developer with both the code and designer view and with a considerably good performance enhancement in terms of switch between the views. Any change done in code\designer gets reflected instantly in the other view which is really cool. We see the code view at the top of screen and designer view at the bottom in the horizontal direction. We can change it though for wide screens too and this is what I am explaning now.

The default split view of designer and source code is in horizontal orientation in case you want to have a vertical split view, which many a times is very useful in wide screen monitors, you can do the same by choosing following option:

Tools -> Options -> HTML Designer -> Check the box for Split View Vertically option on right pane.

Note: It does not change instantly though in most of the cases. So, you need to close all the files and might need to close and reopen the solution to get this in effect.

3) How to Open a VS2k8 solution targeting .NET Framework 2.0 in VS 2k5 – Multi-target Platforms in one the coolest features of Visual STudio 2008. Because of the multi-targeting support of VS2k8 we can even target .NET 2.0 Framework and just upgrade our old VS2k5 project to use VS2k8 using the default upgrade wizard.

This works fine but then our expectation might be that in case I need to open the same solution now in Visual Studio 2005 it should open perfectly because I did not change the framework version. It does not happen thought and opening the new solution in VS2k5, you get an error message which says that solution is created by a new version:

Why does this problems come? Well the answer is the differences in solution version identifiers. We find some changes both in the solution file and project file. Project file see an addition of directive “Tools Version = 3.5” in the first line this doesnot create any problems for the MSBuild because the framework version is v2.0.

For the Solution file which the IDE uses to read and load the solution we find change in version for File Format which is set to 10.0 for VS2k8 solution. It looks like:

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project(“{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}”) = “ConsoleApplication2”, “ConsoleApplication2\ConsoleApplication2.csproj”, “{42BEBBB6-AB4B-40B9-9CF6-345B62F8B5F4}”

The line “Microsoft Visual Studio Solution File, Format Version 10.00” make the solution to put 9 when we look at the solution in explorer view. Now to make the solution readable by Visual Studio 2005 we have to make the following change in new solution file:

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005

Project(“{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}”) = “ConsoleApplication2”, “ConsoleApplication2\ConsoleApplication2.csproj”, “{42BEBBB6-AB4B-40B9-9CF6-345B62F8B5F4}”
Now it works perfectly fine in VS2k5 too. The reason behind this is that there are no build\solution file format changes and hence just the version redirection make this solution file to work with a specific VS version.

Hope this will help working with solutions targeting .NET V2.0  and working on VS 2005 or 2008.

More to be followed hence keep checking.

bye for now.


One Response to Tips\Tricks for Visual Studio 2005\2008

  1. Mousheera says:

    I need to leasn Visual studio ASAP

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Who am I what am I doing?

Who am I what am I doing?

%d bloggers like this: