All of you are familiar with Silverlight and know how to create a Silverlight project. This post is not for the people, who already worked in Silverlight, but for the people who are very new in this technology and start to work as fresh to make their hands dirty. Also, creating this post to refer the project creation in my upcoming tutorial series.

If you are a beginner to Silverlight, read this post to know how to create a Silverlight project.

Setting up the Environment

Before doing anything, you first need to setup your development environment. Silverlight 5 Beta has been released on 13th April 2011 at MIX conference. You can find the installation instruction and download links from the below link:

Create your Project

Once you done with all the installation and ready with your proper development environment, it's the time to start creating your Silverlight 5 Project. Follow the below steps to create your first Silverlight 5 project.

Open Visual Studio 2010 SP1 and go to File -> New -> Project, as shown below:

This will open the "New Project" dialog on the screen. From the left panel, select proper language "C#" or "VB.Net". Expand your targeted language (Visual C# in my case). Now find the template category called "Silverlight" in the same panel. Click it to filter out the Silverlight Templates in the right panel.

From the right panel, select the "Silverlight Application" template. Give a proper name and location for your project and click "OK" to continue.

This will open the "New Silverlight Application" dialog in the screen, as shown below:

Make sure to check the "Host the Silverlight application in a new Web site" checkbox, if you want to host your Silverlight application inside a web project automatically. The IDE will create and configure everything for you.

In the "Options" pane, choose "Silverlight 5" as the Silverlight version. If you want to work with any previous version like Silverlight 3 or Silverlight 4, you can easily change it from here. In our case, we want to create a Silverlight 5 project. Hence, selected "Silverlight 5" as the target version. Click "OK" to continue.

This will create the Silverlight project. In the solution explorer, you will find two projects. One is your main Silverlight application project and the other is your Web Application project which will host your Silverlight XAP.

Once your build has been successfully completed, you will see the XAP file in your ClientBin folder. This is nothing but the output of your Silverlight Application. Run the ASPX or HTML page to host it in the browser window.

Hope, you are now familiar with creating a blank Silverlight 5 project. In next couple of posts I will discuss on the new Silverlight 5 features. Till then keep learning.

If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter, Facebook, Google+ and LinkedIn. I would love to hear your thoughts and opinions on my articles directly. Also, don't forget to share your views and/or feedback in the comment section below.

6
comments

Hi Kunal I have a issue in Silverlight in my project. I have a button , its content is Translate . Now when the button is click then my webpage will be translated in specific language ,how to do it , any suggestion with example , as u described in ur blog with source code .....will be very very help ful

hi kunal can you post artice related to silverlight & microsoft Prism in which we use Shell,Regions & Views to make amaster page in silverlight, i found one tutorial but it was hard to understand....ur article are easier to understand so if you know about Masterpage concept in silverlight plz post a article...thnx in advance

i have started learning Silverlight by checking out your website. but after installing the silverlight developer version, i am getting an ERROR after the vb2010 creates a new project then in the designer part it is showing me as Unhandled exception has occured now what should i do to remove this error.

It's a common issue in Visual Studio 2010 and doesn't have any proper solution if caused. Alternatively, you can get out of this issue by turning off the XAML design view. Read more about it here: http://www.kunal-chowdhury.com/2011/08/how-to-get-rid-of-xaml-design-view.html

About Me

Kunal Chowdhury is a Windows Platform Development MVP of Microsoft, a Telerik MVP, Nokia Developer Champion, Speaker in various Microsoft events, Author, passionate Blogger and a Software Engineer by profession.