Visual Studio Item Template for Silverlight Interface

by Jason Haley 3. April 2011 19:16

This has been on my list to fix for awhile now … TODO: Create an interface template for Silverlight projects in Visual Studio.

For anyone else who has started working with Silverlight and wished there was an interface template – this post is for you.

Once you get the template in the right location and follow the instructions below, you’ll have the interface template available when you add a new item to your Silverlight project (like shown below):

image

Follow these steps to get the template installed on your machine (NOTE: these are pretty much the same instructions from the How to Add MVC 3 Project Types to the Azure Cloud Service Wizard blog post a couple of weeks ago):

Step 0: Get the Item Template zip file

Download the SilverlightInterface.zip file

Step 1: Put the item template where VS will use it

Copy the zip you downloaded from Step 0 to the following directory: 

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Code\1033

My directory has the following files and looks like this after I copied the template over:

image

Step 2:  Delete the ItemTemplateCache directory contents

This will make sure VS uses the added template.  In you Windows Explorer go to the following directory and delete all the contents of the directory:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache

Step 3:  Have Visual Studio Rebuild its Template Cache

Open a VS Command Prompt (found under Visual Studio 10 –> Visual Studio Tools on you start menu).

Run the command: devenv.exe /installvstemplates

Depending on your machine and what you have installed, this could take between 2 – 15 minutes.  My laptop takes ~3 minutes but my desktop takes much longer.

Comments (0) | Post RSSRSS comment feed |

Categories:
Tags:

Comments

Comments are closed