Tuesday, October 29, 2013

Debugging Code in Code Map

 

Code Maps are now integrated with visual studio debugger. So when you debug the code you can see the stack trace in a visual manner.

To Integrate you debugger you can use the following icon in visual studio so it will create the code map for you debugging session. When you start debugging of you code you will see this icon.

image

When you click on the the icon, it will generate the code map for you, & when you stepping through the code parts it will show you visually where you exactly are as below. Arrow will show the current position.

image

You can add comments while you debugging the code for reference. Then if you want you can share your visualized version of you debugger session with the team as below.

image

This helps you to visualize your debugger more effective way.

http://channel9.msdn.com/Series/Visual-Studio-2012-Premium-and-Ultimate-Overview/Visual-Studio-Ultimate-2012Debug-visually-with-Code-Map-debugger-integration

Happy Debugging !!!!!!!!!!

Thursday, October 24, 2013

Change Tfs Workspace Name

 

In case in you have changes your computer name & you want to change the Tfs workspace name follow the following command.

1. Load the Visual Studio developer command prompt.

2. Run the Following Command

tf workspaces /updateUserName:OldUserName /collection:http://Tfs_server:8080

 

you can find more command here.

http://msdn.microsoft.com/en-us/library/cc31bk2e(vs.80).aspx

Tuesday, October 15, 2013

Code Maps In VS 2012

 

Code maps is another attractive visualization tool came with VS 2012 Update 1. it is more similar to the dependency graphs but this has more usability as this has been integrated with visual studio debugger so that the user can use this to visualize their debugging stack trace using this. We will see how we can use this.

Generate a Code Map :

Right click on the method which you want to evaluate & then click on “Show on code map”

 

image

then it will generate a code map as below.

image

Adding Items to Code Map:

when you right click on the “DrawRectangle” in the surface you will get some options to add items to your map as you prefer.

  1. Show Fields this references :- Will show all the global fields or properties which this particular method is referencing. In the code sample which I am using this method using a global variable named rectangle.

image

2. Find All References :- suppose you have a bug in the DrawRectangle(). so you  need to see what are the other methods which referencing this “rectangle” object. you can right click on that “rectangle” property & click on “Find All References”. it will show you all the methods referencing this variable.

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

There are some other options are also available as follows you can use it as per your requirement.

image

Feature: -

1. Legend

You can see the legend by going to the Code Map Toolbar:

image

2. Get details about a method

You can hover your mouse over any node to get more detail also you can double-click any node to see the code associated with it.

image

3. Flags

You can also flag nodes using a variety of colors to indicate some type of action needs to be taken.

image

3. Comments

Also you can add comments to your code map if you want to note something when you analyzing the code for you or your team members future reference.

image

3. Sharing

You can share the code map you have created. There are several sharing options available for you in the code map tool bar.

image

You can find a video on code maps here.

http://channel9.msdn.com/Series/Visual-Studio-2012-Premium-and-Ultimate-Overview/Visual-Studio-Ultimate-2012-Understanding-complex-code-with-Code-Map-ENU

We will discuss how to attach the debugger with the code maps in my next post. Until that…

Happy Visualizing !!!!!!