Creating and using snippets in Visual Studio 2008

0

Posted by Joe | Posted in Visual Studio 2008 | Posted on 04-02-2010

Visual Studio contains a number of predefined snippets. Snippets are usually available for common code that is used frequently allowing the developer to insert this code quickly without having to retype it every time. I often use the try and if snippets, but you can also create your own custom snippets. Recently I found myself to be endlessly creating a try/catch block where in the catch I was logging an exception using a custom logger class, so I decided to create a custom snippet to do this for me. In this post I’ll explain how to create a basic snippet, how to configure Visual Studio to use the snippet, and how to use it in code.

Read the rest of this entry »

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

Visual Studio closing when trying to choose items for the toolbox

0

Posted by Joe | Posted in Visual Studio 2008 | Posted on 02-06-2009

The other day I was trying to add new items to my toolbox in Visual Studio 2008 and each time Visual Studio would close itself without reason. I tried the Reset Toolbox option which didn’t solve the problem.

I then tried running Visual Studio in safe mode by choosing run from the start menu and typing ‘devenv /safemode’. In safe mode I was able to get the Choose Items dialog so I just flicked through all the tabs to make sure it was working. I then closed Visual Studio and loaded it normally and everything worked as expected.

Not sure why it happened but this seemed to fix it :)

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit