Tuesday, April 29, 2008

Tip\Tricks for Visual Studio 2005\2008

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

1) Open Solution or Project folder in Explorer – In VS 2005 you can view the containing folder for any file by right-click on IDE tab. In VS 2k8 you can view project folder in explorer from right-click to project name and finding a new entry named “Open Folder in Windows Explorer”. Same is shown below:






2) Vertical Split View – In VS2k8 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 following:



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


3) How to Open a VS2k8 solution targeting .NET Framework 2.0 in VS 2k5 – Because of the multi-targeting support of VS2k8 we can even target .NET 2.0 Framework and just upgrade my old VS2k5 project to use VS2k8 but then my expectation would be that in case I need to open the same it should open perfectly in VS2k5 but it doesn’t happen. VS2k5 says that solution is created by a new version though in case of projects you can open the same in VS2005.



The differences in project file are addition of Tools Version = 3.5 in the first line and addition of 3.5 hence it works there is no problem with a tag for MSBuild. Though for IDE to read the solution file the change are version different in 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}"
EndProject

If we change the highlighted part to:
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
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.

More to be followed hence keep checking…

No comments: