Getting Started with RIA Services – Silverlight 4 Beta & Visual Studio 2010 Beta 2

I just saw Peter Kellner give a good demo of RIA Services, so I thought I’d try my version. We all like watching Tim Heuer’s videos so everyone does their own spin on it. I’m not sure where I’ll end up with these series of blog posts, but I do know I need to start from the beginning. And this is the beginning. It is hard to do this stuff (RIA Services) if you are totally new to .NET, but if you’ve done a few Web Form or WinForm apps, you should be good to go here.

This is about “Hello World” for RIA Services using Visual Studio 2010 and Silverlight 4 Beta.

The RIA Services provides a pattern to write application logic that runs on the mid-tier and controls access to data for queries, changes and custom operations.

It also provides end-to-end support for common tasks such as data validation, authentication and roles by integrating with Silverlight components on the client.

Long term we want to build out a complete application. But for now we want to get setup.

This blog is about getting setup to develop RIA Services with VS 2010 Beta 2. We just want to verify we can say, “File, New Project,” compile, then Run.

Here is where we are going in a future blog:

  • Great Programming model
    • Silverlight Business Application that consist of 2 projects: a Silverlight client and an ASP.NET Web Application.
    • This provides all the needed infrastructure to test and deploy your Silverlight application
  • AdventureWorks is the sample database
    • We will use an Entity Data Model based on the AdventureWorks sample database
  • Entities are the way to go
    • Applications using the EDM define entities and relationships in the domain of the application in a design schema.
    • The design schema is used to build programmable classes used by application code.
    • Storage structures that persist data for applications in this model are represented in another schema called the storage schema.
    • A mapping specification connects the design schema and the storage schema.
  • Rely on WCF
    • We will let WCF do the work of communicating data.
    • This will be called the Domain Service.
      • Domain services are WCF services that expose the data access layer to the client project.
      • When you create an instance of a domain service, you specify the entity classes that you want to expose and the data operations that are permitted through the domain service. 
      • We will modify and add custom queries to the Domain Service.
  • Multiple Pages Per Silverlight App
    • We will create additional Silverlight pages to present data to users.
    • The amount of custom UI development with Silverlight is huge. We will try to develop some examples.
  • Building the Interface
    • We will add buttons to the default navigation bar to access the Silverlight pages.
    • Configuring the Silverlight pages to display data by dragging items from the Data Sources window to the Silverlight Designer
    • Sorting and paging of the data
    • Configuring a user interface to take query parameters

Click on “Get Started with Silverlight”

image

image

 

That is easily fixed however.

Silverlight 4 Beta Tools for Visual Studio 2010

or

https://go.microsoft.com/fwlink/?LinkID=177508

image

image

It will take a while to install. I looked at my running processes and ngen.exe was running in the background. The Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor. Cool stuff. This can take up to 15 minutes to complete.

image

This should be it. You will need to have Visual Studio 2010 Beta 2 installed as well. This is explained below.

 image

The above steps should work. You may have to uninstall previous versions of Silverlight 3. Go into “Control Panel” and select “Uninstall a program.”

 

Important Link

image

We are interested in .NET RIA Services

image

The click we really want is:

image

image

I am using Visual Studio Beta 2, so the logical download is:

https://www.microsoft.com/downloads/details.aspx?FamilyID=91998faf-d2df-42bb-af2e-17d43d7ce078&displaylang=en

   image

 

image

You can download the wonderful Visual Studio 2010 with Beta 2 at:

https://msdn.microsoft.com/en-us/vstudio/dd582936.aspx

The price is right. It is free.

 image

 

image

Never hurts to get some documentation:

image

https://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=b6127b9b-968c-46c2-8cb6-d228e017ad74

image

Don’t for get the Silverlight Toolkit, which is a collection of Silverlight controls, components and utilities made available outside the normal Silverlight release cycle.

 image

Run the .msi file.

image

Microsoft Silverlight 4 Toolkit November 2009 Setup.

image

The default is to install everything.

image

Display the Welcome Page.

 image

This is the welcome page.

image

Download some help while you are at it:

image

image

We can start by clicking “New Project” and the making the appropriate entries as seen below.

image

Make sure to select the following:

  • .NET Framework 4 ( this is very important )
  • Silverlight Business Applicatoin
  • Folder of your choice

image

You should end up with the following project:

image

Let’s go to our Silverlight control and say “Hello World”.

Untitled-1

Change the text “Home page content”

image

Goto the “Build” menu, and choose “Build Solution.” 

image

Set the Start Page and make sure “HelloWorld.Web” is the start project.

image

 

Now run (hit F5) to see “Hello World !”

image

This is the beginning to a much larger journey. My goal is to get this Silverlight application to get data from the AppFabric or from Azure.