Archive for the ‘Visual Studio’ Category

If you encounter this situation that green play button, f5 key or Start Debugging option is disabled in visual studio.

Cause:

You have more than one project in Visual Studio solution but none of them is set up as a “Set as Startup Project”.

 

Solution:

Right click on one of the project and click on the “Set as Startup Project” now the Start green play button, F5 key and Start Debugging option will be enabled.

Office PIAs deployment

Posted: April 29, 2011 in ASP.NET, Visual Studio

When we use office PIAs in our applications they are fine on development box but when we have to deploy it to shard hosting where Office is not installed then we have to include these files in our bin folder.

We ran into the same situation. We did search on it and people suggested to include them in bin folder. But first question was from where we have to download it, after exploring lot of forums we found the download location here.

When we downloaded and extacted the files we could not get any clue where it installed PIAs on the machine in GAC, in office folder or some where else.

After doing search again we found these extracted PIAs under C:\Program Files\Microsoft Visual Studio 9.0\Visual Studio Tools for Office\PIA\Office12.

We copied it from there to our Bin folder.

Hopefully it will save some one’s time, if some one have the same problem.

You can cut or copy a line in visual studio with out selecting it, just put the cursor any where on the required line and press ctrl+x or ctrl+c.

It works in all the files in visual studio like in aspx, code behind, .txt, .css, .js and .asmx etc.

Debugging in Visual Studio

Posted: June 27, 2010 in Visual Studio

Debugging is very useful technique to test your code that does it works the way you want. In debugging you put break points in your code to check the flow of the program execution and values of the local and global variables at that point of time.

In Visual Studio it is very easy to debug code. Just put the cursor on the line where you want to set a break point, hit F9 key, or click on the gray area in the left most column of the line. To unset break point just hit F9 key again or click on the break point it will remove the break point from that line of code.

After setting the break point Run your code by press F5 key, execution will be stopped on the break point. Now you have many options here to resume the execution. You can move line by line by pressing F10( Step Over) key, or if a line contains a method call then you can press F11 key (Step Into) to go into the function and do the same thing here or You can press F5 key to continue the execution of the program until the next break point is reached or to the end of the program.

During debugging you can check the values of variables by hovering the mouse over them or right click on the variable and choose “Quick Watch” or “Add to Watch” option from the context menu.

You should debug each and every line of the code where you feel that a problem can occur.

Visual Studio 2010 has a lot of new things to improve the productivity.