Watching:

Understanding the Visual Studio project structure


show more Understanding the Visual Studio project structure provides you with in-depth training on Developer. Taught by Walt Ritscher as part of the Silverlight 5 Essential Training show less
please wait ...

Understanding the Visual Studio project structure

When you create a Silverlight project in Visual Studio, it uses a template to generate an assortment of application settings and files and it places these in one or more projects. In this movie I want to explore the standard items that are produced for Silverlight project. I am inside Visual Studio and I've opened the UnderstandingProjectStructure Solution. It contains the two standard projects, this first one is my Silverlight project and the second one in Solution Explorer is my Web Application, my companion website. Solution Explorer, as you might recall, is a container for all of the projects and their files.

A Solution can contain projects and projects contain files. Let's look at what's inside the Silverlight project. There are four areas I want to examine inside this project structure. First I'll start by looking at the Properties section. Inside the Properties section is a dialog that contains different settings for this Silverlight application, the two that I want to look at today are Silverlight and Debug. In the Silverlight section, I can change the output name of my Assembly and I can also change something called the Default namespace. When I create a brand new class or other code entity, it will be placed in whatever default namespace I specify here.

I can also choose which version of Silverlight to target, I'm choosing Silverlight 5, and there are a number of other settings in here than I'll cover later. The second node that I want to look at is the Debug node. Here you can see that it says to Dynamically generate a test page. Silverlight needs be hosted in a HTML or PSP.net page. Since I'm in this Silverlight project and it is set as the startup; you can tell that because it's in bold, there has to be a test harness HTML page. This setting tells it to dynamically generate that HTML page.

If I come down and switch to my ASP. net application to be my startup, by right-clicking here on this node and choosing Set as StartUp Project, now the host page will be either this HTML page or this ASPX page. Within the project you can see the Properties node. There's also a References node. The References node shows which .Net assemblies are used in this application. The Compiler will copy some of these into the finished XAP package. There also two xaml files inside this project. The App.xaml file contains global settings and global events.

If I double-click on this file, it will load the xaml file in a Text Editor. Over here you can see the XML. There's also a code behind for App.xaml which you can see by clicking on this node and looking at this file, App.xmle.cs. If I double-click on this node, you'll see that it loads a code editor. There's more in this code editor later in the series. The main UI of my application is contained here in MainPage.xaml. I will double-click on this node and you'll see that it loads the Designer. The top half of the screen is the visual designer and the bottom half is the XML designer.

Let's examine the second project. It also has a Properties node and a References node and a number of ASP.net specific files. When I double-click on the Properties node you'll see that it opens up the settings that are specific for ASP.net. For instance, here I'm targeting the .NET 4 Framework and they're also Web specific settings here. The one that I want to look at today is down here, the Silverlight Applications node. I'll open this up and this lists all of the Silverlight Applications that I'm currently using in my ASP.net application. I could have more than one, each one of those will be listed here, and when I compile, this section tells the Compiler where to put the output file.

This is saying take my Silverlight xap file, my XAP file and put it in the ClientBin folder. So if I open up this ClientBin folder, you'll see that there is my XAP file loaded there. Each project in my Visual Studio Solution is dedicated to one type of project and you've seen some of the details about how each project is organized.

Understanding the Visual Studio project structure
Video duration: 3m 38s 8h 52m Beginner

Viewers:

Understanding the Visual Studio project structure provides you with in-depth training on Developer. Taught by Walt Ritscher as part of the Silverlight 5 Essential Training

Subject:
Developer
Software:
Silverlight Visual Studio
Author:
please wait ...