The i-Technology Media!
Register | Log in
   
 
.NET  ·  AJAX  ·  CLOUD  ·  ECLIPSE  ·  FLEX  ·  OPEN WEB  ·  iPHONE  ·  JAVA  ·  LINUX  ·  OPEN SOURCE  ·  ORACLE  ·  PBDJ  ·  SEARCH  ·  SILVERLIGHT  ·  SOA  ·  VIRTUALIZATION  ·  WEB 2.0  ·  WIRELESS  ·  XML
Comments
Drool, Britannia? Is the UK Failing the Cloud?
By Roger Strukhoff
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Jan. 8, 2012 11:38 AM EST
read more & respond »
Cloud Expo on Google News
Did you read today's front page stories & breaking news?

Cloud Expo & Virtualization 2011 West
Keynotes
Oracle
Opening Keynote | An Enterprise Cloud for Business-Critical Applications
Abiquo
Day 2 Keynote | The Enterprise Cloud Tightrope - Balancing for Success
Akamai
Day 3 Keynote | The DNA of an Enterprise Cloud
DIAMOND SPONSOR:
Oracle
Many Clouds, Many Choices'Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Enterprise Cloud Best Practices - Town Hall - Join the discussion…
PLATINUM SPONSORS:
Intel
Progressing Toward the Federated, Automated and Client-Aware Cloud
New Relic
How to build an app with Twitter-like throughput
Rackspace
Computing in the Cloud Era
GOLD SPONSORS:
Gale Technologies
Practical Cloud Migration
IBM
Re-think IT. Re-inventing Business.
Intel/McAfee
Identity Driven Security in the Cloud
PerspecSys
Hackers Hackers Everywhere, Is My Public Cloud That Safe?
Red Hat
Unlock the Value of the Cloud
SHI
Mission Critical Applications and the Cloud - Myth or Reality?
SoftLayer
Not Your Grandpa's Cloud
Terremark
Integrating Enterprise Clouds
VMware
Upgrade to a vCloud
POWER PANELS:
Cloud Expo Silicon Valley: CTO Power Panel
Cloud Expo Silicon Valley: CEO Power Panel
Cloud Expo Silicon Valley: Cloud SuperStars Panel
Cloud Expo Silicon Valley: CloudNOW Panel
Click For 2010 West
Event Webcasts
Cloud Expo & Virtualization 2011 East
DIAMOND SPONSOR:
Dell
Dell & VMware Deliver the Enterprise Hybrid Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Are Financial Services Organizations Risking Security by Avoiding Cloud Computing?
Oracle
From Consolidation to Enterprise Private PaaS
PLATINUM SPONSORS:
Intel
Driving the Transformation to Next Generation Cloud Data Centers
Rackspace
The Inevitability of an Open Cloud
GOLD SPONSORS:
CA Technologies
Follow YOUR path to Cloud Computing
Interxion
Who Keeps the Cloud in the Air?
Microsoft
Patterns for Cloud Computing
PerspecSys
War in the Clouds: Are you ready?
ServiceMesh
The Big Win: Stop Playing Small-Ball with Your Cloud Strategy
Terremark
Evaluating Enterprise Clouds
Xiotech
Cloud Storage: Myths and Realities
POWER PANELS:
Cloud Expo New York: CTO Power Panel
Cloud Expo New York: CEO Power Panel
Cloud Expo New York: CMO Power Panel
Cloud Expo New York: Wrap-Up Power Panel
Click For 2010 West
Event Webcasts
Live Google News by SYS-CON!
Top Three Links You Must Click On


From the Blogosphere
.NET RIA Services: Separate Solution Files
Business Apps Example for Silverlight 3 RTM and .NET RIA Services July Update: Part 22

By: Brad Abrams
Aug. 12, 2009 03:00 PM

Still updating my Mix 09 Silverlight 3 + RIA Services talk with more fun stuff.  This time I take up a challenge from Mr. Wildermuth.  Shawn recently raised a very interesting issue with RIA Services development.  He works with a lot of large enterprises that need to have separate solution files for their client and server projects.  Generally we recommend the RIA Services Class Library projects for this sort of thing.  But there are some cases where even more flexibility is needed.  To take up this challenge, I have factored my (now famous?) SuperEmployee’s app into two solutions: one from client and one for server.

You can see the full series here.

The demo requires (all 100% free and always free):

  1. VS2008 SP1
  2. Silverlight 3 RTM
  3. .NET RIA Services July '09 Preview

Also, download the full demo files

The first thing to understand about this scenario is that all of the codegen from RIA Services actually done with MSBuild tasks that can be used outside from the VS IDE… this is important for build machine scenarios or more complex project structure (as we will see here).  There are really two steps here… first we build out the web server solution, then we build a separate solution for the client.     Thanks to our development manager, Jason Allor for working out these steps..

 

Build the Web Server:

  1. Open Visual Studio and create a new ASP.Net Web Application project. This results in a new solution containing just this server project.
  2. Add references to the RIA assemblies, including System.Web.Ria, and System.ComponentModel.DataAnnotations

image

3. Add the Silverlight div to the default.aspx page..

    <div id="silverlightControlHost">

    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">

    <param name="source" value="ClientBin/MyApp.xap"/>

    <param name="onError" value="onSilverlightError" />

    <param name="background" value="white" />

    <param name="minRuntimeVersion" value="3.0.40624.0" />

    <param name="autoUpgrade" value="true" />

    <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">

    <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>

    </a>

    </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>

    </div>

4. Hook in your back-end data source as I showed in past posts..

5. Author a DomainService class which exposes one or more query methods, insert and update methods, etc. Ensure that this class contains the EnableClientAccess attribute, again, just like i showed in past posts

6. Build the solution and ensure that it compiles without errors.

7. Close VS.

Build the Client:

  1. Open a new instance of Visual Studio and create a new Silverlight Application project. When prompted, uncheck the “Host the Silverlight application in a new Web site” checkbox. This also removes the “Enable .NET RIA Services” checkbox.
    image
  2. Add references to the RIA and data assemblies, including
    System.Windows.Ria, System.Windows.Ria.Controls, System.Windows.Data, System.Runtime.Serialization, and System.ComponentModel.DataAnnotations
  3. Save the solution.
  4. Right-click on the project node in Solution Explorer and select Unload Project
    image
  5. Right-click on the project node in Solution Explorer and select Edit .csproj

image

6. Find the <LinkedServerProject> node in the csproj file. It will initially be empty. Fill in the path to the .csproj file from the web server project that you created above.

<LinkedServerProject>..\..\MyApp.Web\MyApp.Web.csproj</LinkedServerProject>

7 . Save and close the .csproj file.

8. Right-click on the project node in Solution Explorer and select Reload Project

image

9. Build the project.

10. Notice that the Generated Code folder shows up and RIA Services has built your client-side entity model for you. You can now consume your data on the client using the standard RIA Services patterns.
image

11. Now we need to copy the resulting XAP to the web app so we can run the app correctly, this is easy enough from the project properties.

image

 

Open the web solution in a separate instance of VS (it is fine to have both solutions open at the same time).. After a little work in the client, we end up with this: 

image

Notice, you can make changes to the client and rebuild, then just hit F5 in the browser and the new XAP will load.

 

So, by setting up the client's LinkedServerProject property manually, we can have the RIA Services client and server projects in different solutions, and\or build them separately in a command-line based build system.  This gives you a lot of flexibility in how you manage large and complex build systems.

 

Hope that helps!

Read the original blog entry...

Published Aug. 12, 2009— Reads 4,249
Copyright © 2009 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
About Brad Abrams
Brad Abrams is currently the Group Program Manager for the UI Framework and Services team at Microsoft which is responsible for delivering the developer platform that spans both client and web based applications, as well as the common services that are available to all applications. Specific technologies owned by this team include ASP.NET, Atlas and Windows Forms. He was a founding member of both the Common Language Runtime, and .NET Framework teams.

Brad has been designing parts of the .NET Framework since 1998 when he started his framework design career building the BCL (Base Class Library) that ships as a core part of the .NET Framework. He was also the lead editor on the Common Language Specification (CLS), the .NET Framework Design Guidelines, the libraries in the ECMA\ISO CLI Standard, and has been deeply involved with the WinFX and Windows Vista efforts from their beginning.

He co-authored Programming in the .NET Environment, and was editor on .NET Framework Standard Library Annotated Reference Vol 1 and Vol 2 and the Framework Design Guidelines.

Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers

ADS BY GOOGLE

Breaking Java News
National Coalition Holds Prescription Drug Take-back Day in Palm Springs Ahead of Pain Medicine Scientific Meeting
Media Advisory/REMINDER: Astronaut Chris Hadfield Talks About His Upcoming Mission at AAAS Family Science Days in Vancouver
Harper Government Energizing Future Farm Leaders
United Launch Alliance Celebrates 50 Years of Americans in Orbit
MEDIA ALERT: Muttahida Quami Movement (MQM) and Canadian National Committee for UN Women, President to Celebrate Pakistan Women's Public Meeting
Bull & Lifshitz, LLP Announces Investigation of General Bearing Corporation
Bull & Lifshitz, LLP Announces Investigation of SeraCare Life Sciences, Inc.

ADVERTISE   |   MAGAZINE SUBSCRIPTIONS   |   FREE BREAKING-NEWSLETTERS!   |   SYS-CON.TV   |   BLOG-N-PLAY!   |   WEBCAST   |   EDUCATION   |   RESEARCH

.NET Developer's Journal - .NETDJ   |   ColdFusion Developer's Journal - CFDJ   |   Eclipse Developer's Journal - EDJ   |   Enterprise Open Source Magazine - EOS
Open Web Developer's Journal - OPENWEB   |   iPhone Developer's Journal - iPHONE   |   Virtualization - Virtualization   |   Java Developer's Journal - JDJ   |   Linux.SYS-CON.com
PowerBuilder Developer's Journal - PBDJ   |   SEO / SEM Journal - SJ   |   SOAWorld Magazine - SOAWM   |   IT Solutions Guide - ITSG   |   Symbian Developer's Journal - SDJ
WebLogic Developer's Journal - WLDJ   |   WebSphere Journal - WJ   |   Wireless Business & Technology - WBT   |   XML-Journal - XMLJ   |   Internet Video - iTV
Flex Developer's Journal - Flex   |   AJAXWorld Magazine - AWM   |   Silverlight Developer's Journal - SLDJ   |   PHP.SYS-CON.com   |   Web 2.0 Journal - WEB2
Apache   |   CMS   |   CRM   |   HP   |   Oracle Journal   |   Perl   |   Python   |   Red Hat   |   Ruby on Rails   |   SAP   |   SaaS

SYS-CON MEDIA:   ABOUT US   |   CONTACT US   |   COMPANY NEWS   |   CAREERS   |   SITE MAP
SYS-CON EVENTS:   |  AJAXWorld Conference & Expo  |  iPhone Developer Summit  |  Cloud Computing Conference & Expo  |  SOA World Conference & Expo  |  Virtualization Conference & Expo
INTERNATIONAL SITES:   India  |  U.K.  |  Canada  |  Germany  |  France  |  Australia  |  Italy  |  Spain  |  Netherlands  |  Brazil  |  Belgium
 Terms of Use & Our Privacy Statement     About Newsfeeds / Video Feeds
Copyright ©1994-2008 SYS-CON Publications, Inc. All Rights Reserved. All marks are trademarks of SYS-CON Media.
Reproduction in whole or in part in any form or medium without express written permission of SYS-CON Publications, Inc. is prohibited.
 
close this window