<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Al Pascual ASP.NET Blog</title><subtitle type="html">My blog at the ASP.NET mother ship, check my personal blog at http://alpascual.com</subtitle><id>http://weblogs.asp.net/albertpascual/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/albertpascual/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2009-07-20T07:34:00Z</updated><entry><title>Error running ASP.NET application with impersonation: runtime Failed to start monitoring changes</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/10/28/error-running-asp-net-application-with-impersonation-runtime-failed-to-start-monitoring-changes.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/10/28/error-running-asp-net-application-with-impersonation-runtime-failed-to-start-monitoring-changes.aspx</id><published>2009-10-29T03:01:00Z</published><updated>2009-10-29T03:01:00Z</updated><content type="html">&lt;p&gt;When you get this error “ASP.NET runtime Failed to start monitoring changes (…) ” on your ASP.NET app is frustrating to find what is causing this problem, normally is when you moved an application from a computer to another. I personally seen it happen in Windows Vista and Windows 7 machines.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The solution.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you using impersonation you’ll find that removing the impersonation key will fix your issue, of course you need impersonation for your application to have access to other resources. I recommend to add that user in the ASP.NET process account.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Documentation of the issue from Microsoft can be found here.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://support.microsoft.com/kb/317955" href="http://support.microsoft.com/kb/317955"&gt;http://support.microsoft.com/kb/317955&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; Hope this helps&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7241910" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/albertpascual/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>Problems running Windows Communication Foundation (.svc) on an upgraded Windows 7 and IIS 7</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/10/20/problems-running-windows-communication-foundation-svc-on-an-upgraded-windows-7-and-iis-7.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/10/20/problems-running-windows-communication-foundation-svc-on-an-upgraded-windows-7-and-iis-7.aspx</id><published>2009-10-21T03:16:00Z</published><updated>2009-10-21T03:16:00Z</updated><content type="html">&lt;p&gt;The installation to upgrade from Vista to Windows 7 does not fix or upgrades IIS 7. So IIS 7 wasn’t fix to run Silverlight xap files of Windows Services.&lt;/p&gt;  &lt;p&gt;When trying to run a Windows Service with SVC extension on a Windows 7 machine that was upgraded from Vista, IIS 7 won’t be changed to register the .xap file for silverlight or windows services extensions, you’ll have to do that manually in IIS 7.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Registering the Silverlight XAP extension.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Go to your IIS Manager and open the Mime Types&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_65F63556.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_0FF6337F.png" width="244" height="217" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;For File extension enter: .xap&lt;/p&gt;  &lt;p&gt;For Mime type enter: application/x-silverlight-app&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_163D0A0D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_4E7B8125.png" width="244" height="143" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Register the Windows Service on IIS7&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Do not register the .svc extension like xap, you need to register in a different way, open a console application running as Administrator, navigate to:&lt;/p&gt;  &lt;p&gt;C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation&amp;gt;&lt;/p&gt;  &lt;p&gt;Run ServiceModelReg –i&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Finally restart IIS with a normal Iisreset or using the IIS manager.&lt;/p&gt;  &lt;p&gt;Hope this helps&lt;/p&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Al&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/alpascual"&gt;Follow me in twitter&lt;/a&gt; | &lt;a href="http://silverlightme.net/"&gt;bookmark me&lt;/a&gt; | &lt;a href="http://alpascual.com/blog/al/rss.aspx"&gt;Subscribe to my feed&lt;/a&gt; | &lt;a href="http://mapStats.net"&gt;Add stats to your blog&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7234241" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/albertpascual/archive/tags/.NET/default.aspx" /><category term="Windows 7" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Windows+7/default.aspx" /></entry><entry><title>The ESRI Latin American Conference in Bogota, Colombia</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/10/09/the-esri-latin-american-conference-in-bogota-colombia.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/10/09/the-esri-latin-american-conference-in-bogota-colombia.aspx</id><published>2009-10-09T19:17:00Z</published><updated>2009-10-09T19:17:00Z</updated><content type="html">&lt;p&gt;I was lucky enough to travel to Bogota to teach a ESRI ArcGIS Silverlight API workshop for the LAUC. All ESRI distributors in South America came to the conference and some came to the workshop. Was great meeting all the people passionate about GIS. It’s always great to travel to different countries and learn new cultures. Kills me to be away from my wife and kids, yet the opportunity of seeing new countries and meeting new people is just great. Below a few snapshots of the week.&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/photo2_725FFB93.jpg"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="photo-2" border="0" alt="photo-2" src="http://weblogs.asp.net/blogs/albertpascual/photo2_thumb_31517C2F.jpg" width="318" height="240" /&gt;&lt;/a&gt; Picture above the ESRI logo in Spanish&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/photo3_698FF347.jpg"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="photo-3" border="0" alt="photo-3" src="http://weblogs.asp.net/blogs/albertpascual/photo3_thumb_2FA0B05B.jpg" width="184" height="244" /&gt;&lt;/a&gt;The class learning the ESRI Silverlight API for ArcGIS Server. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/102_1164_15CC7A2C.jpg"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="102_1164" border="0" alt="102_1164" src="http://weblogs.asp.net/blogs/albertpascual/102_1164_thumb_67FEB166.jpg" width="286" height="216" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Picture above of the students attending the Silverlight workshop from different ESRI distributors at break time.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/photo_203D287F.jpg"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="photo" border="0" alt="photo" src="http://weblogs.asp.net/blogs/albertpascual/photo_thumb_6A583364.jpg" width="184" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;Picture above a lunch with all the students, Silverlight and Flex. &lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/photo1_37882CF0.jpg"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="photo-1" border="0" alt="photo-1" src="http://weblogs.asp.net/blogs/albertpascual/photo1_thumb_2F908A8E.jpg" width="244" height="184" /&gt;&lt;/a&gt;Picture above a menu item, the World Trade Center for $13,500 pesos.&amp;#160; &lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/photo4_6F0D053E.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="photo-4" border="0" alt="photo-4" src="http://weblogs.asp.net/blogs/albertpascual/photo4_thumb_671562DC.jpg" width="184" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;Kerry Coffin (the Flex instructor) with the Mayor of Bogota.&lt;/p&gt;  &lt;p align="center"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;Was great meeting all the great people that is passionate in GIS, Bogota is a huge busy metropolitan city that I won’t mind to come back, as this time I wasn’t enable to visit the city. Next year the ESRI Latin America User Conference will be hosted at the city of Mexico by the ESRI Distributor.&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://twitter.com/alpascual"&gt;Follow me in twitter&lt;/a&gt; | &lt;a href="http://silverlightme.net/"&gt;bookmark me&lt;/a&gt; | &lt;a href="http://alpascual.com/blog/al/rss.aspx"&gt;Subscribe to my feed&lt;/a&gt; | &lt;a href="http://mapStats.net"&gt;Add stats to your blog&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7226344" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author></entry><entry><title>Cloud Camp LA 9/30/2009</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/09/22/cloud-camp-la-9-30-2009.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/09/22/cloud-camp-la-9-30-2009.aspx</id><published>2009-09-23T04:40:00Z</published><updated>2009-09-23T04:40:00Z</updated><content type="html">&lt;p&gt;CloudCamp is coming to LA on&amp;#160; 9/30    &lt;br /&gt;CloudCamp is an unconference where early adapters of Cloud Computing technologies exchange ideas. With the rapid change occurring in the industry, we need a place we can meet to share our experiences, challenges and solutions. At CloudCamp, you are encouraged you to share your thoughts in several open discussions, as we strive for the advancement of Cloud Computing. End users, IT professionals and vendors are all encouraged to participate. This camp is cross platform, so come and learn everything you wanted to know about clould computing and how things stack up.     &lt;br /&gt;This is a FREE event (except for parking.. see below). And we are limited in the number of attendees so Register soon.     &lt;br /&gt;Go here for more information and to register &lt;a href="http://www.cloudcamp.com/?page_id=1263"&gt;http://www.cloudcamp.com/?page_id=1263&lt;/a&gt;     &lt;br /&gt;Location:     &lt;br /&gt;Microsoft Downtown Office (Wells Fargo Tower)     &lt;br /&gt;333 South Grand Ave, Suite 3300 (maps)     &lt;br /&gt;Los Angeles, CA 90071 &lt;/p&gt;  &lt;p&gt;Parking:    &lt;br /&gt;Self parking is available at the Pershing Square Garage, on 5th and South Olive St. This underground structure provides 24-hour security parking for $6.00 flat rate after 5:00 p.m. weekdays. And parking may be free if you get your ticket validated at one of the shops.&amp;#160; (Not at the Wells fargo building it is $40.00 to park there and their is NO Validation)&lt;/p&gt;  &lt;p&gt;Public Transportation:    &lt;br /&gt;Metro Line: You can get here by taking the Metro Red Line, exit Pershing Square station and *exit towards 4th street*. Walk up 4th street, take the big elevator up to California plaza and walk across Grand avenue to     &lt;br /&gt;the Wells Fargo entrance. &lt;/p&gt;  &lt;p&gt;Tentative Schedule:    &lt;br /&gt;5:30pm Registration &amp;amp; Networking     &lt;br /&gt;6:00pm Welcome and Thank yous     &lt;br /&gt;6:15pm Lightning Talks (5 minutes each)     &lt;br /&gt;7:15pm Unpanel     &lt;br /&gt;7:45pm Begin Unconference (organize the unconference)     &lt;br /&gt;8:00pm Unconference Session - Round 1     &lt;br /&gt;Break     &lt;br /&gt;9:00pm Unconference Session - Round 2     &lt;br /&gt;10:00pm Wrap-up     &lt;br /&gt;10:15pm More Networking&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7214961" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term="Code Camp" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Code+Camp/default.aspx" /></entry><entry><title>Starting with Silverlight 3 MEF to load .XAP files dynamically is a little harder than I thought</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/09/10/starting-with-silverlight-3-mef-to-load-xap-files-dynamically-is-a-little-harder-than-i-thought.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/09/10/starting-with-silverlight-3-mef-to-load-xap-files-dynamically-is-a-little-harder-than-i-thought.aspx</id><published>2009-09-11T02:15:00Z</published><updated>2009-09-11T02:15:00Z</updated><content type="html">&lt;p&gt;A few simple steps to start with MEF.&lt;/p&gt;  &lt;p&gt;Download the Managed &lt;a href="http://mef.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30098" target="_blank"&gt;Extensibility Framework from here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Add a reference to the MEF dll System.ComponentModel.Composition.dll found after unzipping the download at the MEF_Preview_6\bin\SL3&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_6786D1A0.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_71D7F600.png" width="244" height="139" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Add a new application to create a new .XAP file&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_46272C04.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_57978CDC.png" width="244" height="225" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Uncheck the box to link it to .NET RIA Services if its installed in your computer yet keep the link to the Web app without creating the test page. Delete the MainPage.xaml as well as the App.xaml&lt;/p&gt;  &lt;p&gt;Add a new UserControl&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_7DF97027.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_1D3C16FB.png" width="244" height="148" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Add these code to add dynamically the xap file to pull it the app, make sure the new xap file is on the ClientBin directory on the Web tier. Otherwise you’ll have to modify the call to be an absolute path.&lt;/p&gt;  &lt;p&gt;var catalog = new PackageCatalog();    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; catalog.AddPackage(Package.Current);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Package.DownloadPackageAsync(new Uri(&amp;quot;NewXapFile.xap&amp;quot;, UriKind.Relative), (s, p) =&amp;gt; catalog.AddPackage(p)); &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var container = new CompositionContainer(catalog);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; container.ComposeParts(this);&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I created the interface and loaded the xap. &lt;/p&gt;  &lt;p&gt;And now you can use the methods inside the user control, happy MEFin’&lt;/p&gt;  &lt;p&gt;Well not so fast, this is where I’m stuck, getting an error after downloading the xap to get the UserControl.&lt;/p&gt;  &lt;p&gt;The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information. &lt;/p&gt;  &lt;p&gt;1) No exports were found that match the constraint &lt;/p&gt;  &lt;p&gt;Is it expected to have some binding instead of just loading UI?&lt;/p&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Al&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7199994" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author></entry><entry><title>.NET RIA Services Part 4: Calling methods on the Server from Silverlight.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/09/08/net-ria-services-part-4-calling-methods-on-the-server-from-silverlight.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/09/08/net-ria-services-part-4-calling-methods-on-the-server-from-silverlight.aspx</id><published>2009-09-08T13:26:00Z</published><updated>2009-09-08T13:26:00Z</updated><content type="html">&lt;p&gt;&lt;a href="http://alpascual.com/blog/working-on-silverlight-net-ria-services-part-2/" target="_blank"&gt;In Part 2 I introduced&lt;/a&gt; the concept of sharing code between tiers. When creating a new class in ASP.NET with the name .shared, .NET RIA Service will generate a hidden class as well in Silverlight with the same code. So you are compiling the code once in each tier, yet they’ll be insync.&amp;#160; This is called the RIA Link.&lt;/p&gt;  &lt;p&gt;Now that causes the problem that you are writing server side code that will run in the browser instead of the server, so its important to think about where do you want the code to run.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;em&gt;Executing ASP.NET methods from the Client.&lt;/em&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;.NET RIA Services also provides a set of Silverlight controls to access data in the Server like the Domain Data Source. This control will send a query on the Silverlight load to consume data from the server and presenting that to the Silverlight tier. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_4A0BF684.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_3E763945.png" width="173" height="174" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Though you won’t find it on the ToolBox after installing .NET RIA Services, you can add a namespace and type it by hand.&lt;/p&gt;  &lt;p&gt;First add the reference to System.Windows.Ria.Controls and recompile the Silverlight application.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_5705D695.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_6876376D.png" width="244" height="205" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Add the namespace on the UserControl:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_35A630F9.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_1BD1FACA.png" width="417" height="68" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;and once you type the control, intellisense will provide you the rest. &lt;/p&gt;  &lt;p&gt;&amp;lt;riaControls:DomainDataSource x:Name=&amp;quot;myriaControl&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;p&gt;Of course you now need to query the data you want to consume using control parameters. Domain Data Sources are very powerful, if you used ASP.NET data sources you’ll be half way there. They give you the ability to sort, filter, edit, paging and grouping as well. I highly recommend you play with them consuming known data to understand further how they work.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;em&gt;Using the .NET RIA Services Class Libraries.&lt;/em&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;From the July 09 release with .NET RIA Services, the developer can create libraries in ASP.NET that can be also referenced in any Silverlight application. The library will be a single entity and assembly instead of making a copy of itself to be in multiple projects. Yet they’ll be a link between both tiers.&lt;/p&gt;  &lt;p&gt;Create a new .NET RIA Services Class library, found on your template with calling New Project&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_463E2BE7.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_3A3C3BB3.png" width="387" height="248" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To use this library, you’ll need to Add a Reference from ASP.NET website as well as add the reference to that library from the Silverlight project.&lt;/p&gt;  &lt;p&gt;Now that library cannot have references to libraries outside the .NET 3.5 dlls. Adding a COM library will cause a compiling error when .NET RIA Services tries to recompile it to use in Silverlight. Yet there is a huge advantage in using these libraries, yet still the 2 projects that will be generated will exist inside a directory.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_597EE286.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_38F7A2D4.png" width="244" height="240" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The results shows 2 libraries. in a folder. When you select to add a reference for the Web application (ASP.NET) you’ll be able to select the RIA Service Library &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_6A831069.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_1EB739B0.png" width="244" height="140" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Make sure you added in Silverlight as well as ASP.NET.&lt;/p&gt;  &lt;p&gt;Now write a method on the Silverlight project just created:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_5042A745.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_01CE14DB.png" width="335" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Then in ASP.NET you can see the method:&lt;/p&gt;  &lt;p&gt;namespace SilverlightApplicationRIA.Web    &lt;br /&gt;{     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public partial class _Default : System.Web.UI.Page     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; protected void Page_Load(object sender, EventArgs e)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RIAServicesLibrary1.Class1 myclass = new RIAServicesLibrary1.Class1();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; myclass.fooRia();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;}&lt;/p&gt;  &lt;p&gt;Easy to now consume methods from Silverlight with ASP.NET. In the Part 2 we saw how to consume ASP.NET data from Silverlight, the sample above is a good example how to consume Silverlight data from the ASP.NET tier.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Site Note:&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;One thing I haven’t being able to figure it out, if why the .Web project gets created, I thought you can in RIA access that ASP.NET library, so who can access that library created and how is the link established?&amp;#160; I cannot access the 2 classes below I created in Silverlight or ASP.NET.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_7CEB611E.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_47729EF9.png" width="204" height="181" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;em&gt;To answer a few emails: Question) How can I have an application like the business template without Authentication?&lt;/em&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;To answer people asking me about the business application, you can just use the navigation application template that does not include the .NET RIA services and the Authentication won’t be enable by default.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_3FE72F8C.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_2612F95D.png" width="327" height="233" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Visual Studio 2008 will ask you if you want to enable .NET RIA Services, I suggest you to enable that to enjoy the powerful Silverlight and ASP.NET communication, yet the result will be what you are looking for, a template like the one in Part 3 without the Login/Logout controls.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_7E6C7D32.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_24CE607E.png" width="244" height="217" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Al&lt;/p&gt;  &lt;p&gt;PS: Best resource for &lt;a href="http://blogs.msdn.com/brada/" target="_blank"&gt;.NET RIA Service posted by Brad Abrams&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.twitter.com/alpascual" target="_blank"&gt;Follow me at Twitter&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7196543" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term=".NET RIA Service" scheme="http://weblogs.asp.net/albertpascual/archive/tags/.NET+RIA+Service/default.aspx" /><category term="Silverlight 3" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Silverlight+3/default.aspx" /></entry><entry><title>Part 3: Accessing Security and Authentication in Silverlight using .NET RIA Services.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/09/04/part-3-accessing-security-and-authentication-in-silverlight-using-net-ria-services.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/09/04/part-3-accessing-security-and-authentication-in-silverlight-using-net-ria-services.aspx</id><published>2009-09-05T02:25:00Z</published><updated>2009-09-05T02:25:00Z</updated><content type="html">&lt;p&gt;Please &lt;a href="http://alpascual.com/tags/net-ria-services/"&gt;read the previous post from this series&lt;/a&gt; you can catch up.&lt;/p&gt;  &lt;p&gt;I have received many questions about the previous post of how the proxy files actually work. I was looking how .NET RIA Service connects ASP.NET and Silverlight, I was expecting the code that I call from Silverlight using the generated proxy file to call the ASP.NET in the server, yet this is not the case, .NET RIA Service makes a complete copy of the file and compiles it under Silverlight, so all the shared code is just that, 2 different classes, one running in ASP.NET and the other running in Silverlight. That’s why you need to make sure the classes you use in ASP.NET are 3.5 compatible.&lt;/p&gt;  &lt;p&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;u&gt;Authentication with .NET RIA Services.&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Creating a Silverlight application and using the Checkbox to enable that project for ,NET RIA services won’t give you everything you need to use the .NET RIA Services Authentication right now, I do not know if that will change on the release version. &lt;/p&gt;  &lt;p&gt;The concept is great, yet, .NET RIA Services is still in development and I believe they haven’t added the “Authentication Domain Service” to secure your Silverlight application with the ASP.NET security context.&lt;/p&gt;  &lt;p&gt;For Authentication .NET RIA Service need to be a little different, as need to run on the ASP.NET, even if you call it from Silverlight. So you want to Authenticate a user from Silverlight and you add this code:&lt;/p&gt;  &lt;p&gt;namespace SilverlightApplicationRIA    &lt;br /&gt;{     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public partial class MainPage : UserControl     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public MainPage()     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; InitializeComponent();&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RiaContext.Current.Authentication.Login(&amp;quot;al&amp;quot;, &amp;quot;pascual&amp;quot;);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;}&lt;/p&gt;  &lt;p&gt;You’ll receive this error from the .NET RIA Services letting you know you need to create a Context first.&lt;/p&gt;  &lt;p&gt;“No contexts have been added to the Application's lifetime objects. For RiaContextBase.Current to resolve correctly, add a single context to the lifetime objects.”&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_119758B4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_474C9E0E.png" width="362" height="134" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So doesn’t work out of the box, you need to configure ASP.NET with a Membership provider and enable authentication on the web.config. The fastest way is to enable Windows Authentication, then create a Domain Service, go to Add –&amp;gt; New Item and select “Authentication Domain Service” &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_2D0C34EA.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_5CE6D6AB.png" width="201" height="262" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This is where the problem starts, you won’t be able to find these item in the list. The item is missing on the lastest .NET RIA Service from July sample.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;em&gt;Using the Business Application Template for Security enable application.&lt;/em&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;So if you want Authentication in .NET RIA Services, you’ll have to create a new project instead of just linking or enabling .NET RIA Services.&lt;/p&gt;  &lt;p&gt;Go to create a new project, select Silverlight and “Silverlight Business Application” to create a new application with many things build in for you.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_6255474F.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_00BF8839.png" width="244" height="211" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Click to register a new user/.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_71A8A95E.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_25709FB0.png" width="244" height="179" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Upon registration and also login in, Silverlight talks to ASP.NET using .NET RIA Services, the biggest concern for developers is how to prevent the credentials to be seen by anybody as the client needs to send it to the server.&lt;/p&gt;  &lt;p&gt;I added Fiddler in the middle to see the communication between the client and the server. Silverlight sends in a post sending the username and password in text.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;POST /ria/ClientBin/DataService.axd/BusinessApplication1-Web-AuthenticationService/Login HTTP/1.1      &lt;br /&gt;Accept: */*       &lt;br /&gt;Content-Length: 58       &lt;br /&gt;Content-Type: application/x-www-form-urlencoded       &lt;br /&gt;Accept-Encoding: gzip, deflate       &lt;br /&gt;User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0)       &lt;br /&gt;Host: alhome       &lt;br /&gt;Connection: Keep-Alive       &lt;br /&gt;Pragma: no-cache &lt;/p&gt;    &lt;p&gt;userName=al&amp;amp;password=hellowworld3%23%23&amp;amp;isPersistent=False&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Works the same way than in ASP.NET with a post into the server, then&amp;#160; is the server that checks the database and does the authentication. So the best way to secure that communication will be using SSL if you do not want to protect the credentials.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_3D27D716.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_3B770B42.png" width="324" height="132" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Credentials get stored into a File database on ASP.NET.&lt;/p&gt;  &lt;p&gt;This template is using the Authentication context to the server&lt;/p&gt;  &lt;p&gt;private AuthenticationService _authService = RiaContext.Current.Authentication;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;em&gt;Securing a Silverlight object using Roles in Silverlight and .NET RIA Services.&lt;/em&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;So this sample will explain using the ESRI Silverlight Map Control, coolest Silverlight control out there, how to protect using Authentication Roles a object in Silverlight.&lt;/p&gt;  &lt;p&gt;In the Home UserControl I added the ESRI Silverlight Map and change the visibility depending on the user authentication.&lt;/p&gt;  &lt;p&gt;public Home()    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; InitializeComponent(); &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (RiaContext.Current.Authentication.IsLoggingIn == true)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MyMap.Visibility = Visibility.Visible;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MyMap.Visibility = Visibility.Collapsed; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RiaContext.Current.Authentication.LoggedIn += new EventHandler&amp;lt;System.Windows.Ria.ApplicationServices.AuthenticationEventArgs&amp;gt;(Authentication_LoggedIn);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RiaContext.Current.Authentication.LoggedOut += new EventHandler&amp;lt;System.Windows.Ria.ApplicationServices.AuthenticationEventArgs&amp;gt;(Authentication_LoggedOut);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; void Authentication_LoggedOut(object sender, System.Windows.Ria.ApplicationServices.AuthenticationEventArgs e)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MyMap.Visibility = Visibility.Collapsed;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; void Authentication_LoggedIn(object sender, System.Windows.Ria.ApplicationServices.AuthenticationEventArgs e)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MyMap.Visibility = Visibility.Visible;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_0BD8ECB6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_6F0F51D3.png" width="244" height="180" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As well I register the events for login and logout to make sure I hide the map when the user logout.&lt;/p&gt;  &lt;p&gt;You can register a username and password or use:&lt;/p&gt;  &lt;p&gt;username: test&lt;/p&gt;  &lt;p&gt;password: test123!&lt;/p&gt;  &lt;p&gt;This is how .NET RIA Services shows the best way to use Role base security using Silverlight.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Hope this helps&lt;/p&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Al&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7192006" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term=".NET RIA Service" scheme="http://weblogs.asp.net/albertpascual/archive/tags/.NET+RIA+Service/default.aspx" /><category term="Silverlight 3" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Silverlight+3/default.aspx" /></entry><entry><title>Working on Silverlight .NET RIA Services Part 2</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/09/02/working-on-silverlight-net-ria-services-part-2.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/09/02/working-on-silverlight-net-ria-services-part-2.aspx</id><published>2009-09-03T03:46:00Z</published><updated>2009-09-03T03:46:00Z</updated><content type="html">&lt;p&gt;If you haven’t &lt;a href="http://alpascual.com/blog/starting-with-net-ria-services/"&gt;please read part 1 before&lt;/a&gt; reading this post.&lt;/p&gt;  &lt;p&gt;The most powerful thing about .NET RIA Services besides the whole framework, is the concept of sharing code from ASP.NET and Silverlight without extra steps and setting up Web Services manually. .NET RIA services provides you an automatic creation of the proxy classes to share the code between those 2 tiers.&lt;/p&gt;  &lt;p&gt;.NET RIA Services is simple, yet introduces a few things for the developer to learn, I hope this simple tutorial will help learn those.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;u&gt;How to share new code.&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;We create a class on the ASP.NET tier.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_36511F40.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_4E74899B.png" width="336" height="200" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;using System;    &lt;br /&gt;using System.Collections.Generic;     &lt;br /&gt;using System.Linq;     &lt;br /&gt;using System.Web; &lt;/p&gt;  &lt;p&gt;namespace SilverlightApplicationRIA.Web.MyCode    &lt;br /&gt;{     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public class MyClass     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public string foo()     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return &amp;quot;Hello World&amp;quot;;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;}&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Writing something so simple and compiling it will generate a proxy file in Silverlight to be created, the key is to name your classes with .shared in order for the .NET RIA Service to pick it up and generate the proxy class.&lt;/p&gt;  &lt;p&gt;If we look into the Silverlight application will find hidden files in the project that you can see going to the Windows Explorer.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_58C5ADFB.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_4D2FF0BC.png" width="204" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;u&gt;How to share existing code.&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;You can select an existing file and select to Add Link instead of just add to create the same file in both tiers.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_779C21D9.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_36F9D56A.png" width="244" height="192" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This option is important to use existing items that you want to exist in both tiers, the physical files are not copied, it just creates a link between them in the hard disk.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;em&gt;How to share a library.&lt;/em&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;You can share .NET 3.5 libraries with Silverlight 3.0. This is what makes .NET RIA Services great, write it once, share it twice. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;u&gt;Consuming the shared code in Silverlight.&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The pattern to consume the code in Silverlight from .NET RIA Services is pretty simple as if you remember there is a proxy copy on Silverlight created. So just add the correct namespace and execute the method synch not asynch like you would do in a web service for Silverlight.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_3D40ABF8.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_159A2FCE.png" width="292" height="132" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;public partial class MainPage : UserControl    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public MainPage()     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; InitializeComponent(); &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SilverlightApplicationRIA.Web.MyCode.MyClass myClass = new SilverlightApplicationRIA.Web.MyCode.MyClass();    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string sText = myClass.foo();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The sText will show a “Hello World” answer.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;u&gt;What about accessing to the ASP.NET Security.&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I’ll cover this part extensively on part 3 of this series, yet to quickly answer the question of all of you that email me about this, you can in Silverlight consume the security context of the ASP.NET application by using the RiaContext class.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_0A04728F.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_697D32DC.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Happy .NET RIA Services coding.&lt;/p&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Al&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7189327" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term=".NET RIA Service" scheme="http://weblogs.asp.net/albertpascual/archive/tags/.NET+RIA+Service/default.aspx" /><category term="Silverlight 3" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Silverlight+3/default.aspx" /></entry><entry><title>Mixing Silverlight and MS ASP.NET AJAX 3.5 in the same web application.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/08/30/mixing-silverlight-and-ms-asp-net-ajax-3-5-in-the-same-web-application.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/08/30/mixing-silverlight-and-ms-asp-net-ajax-3-5-in-the-same-web-application.aspx</id><published>2009-08-31T02:45:00Z</published><updated>2009-08-31T02:45:00Z</updated><content type="html">&lt;p&gt;With the templates coming out of VS2008 when you create a Silverlight application, a ASP.NET Web project is created for you to test your Silverlight app that adds the control into a ASPX page and a HTML page. Many developers will use the power of ASP.NET for server side processing and add a few ASP.NET controls on the page where the Silverlight control is. &lt;/p&gt;  &lt;p&gt;There is when the user will find the problem about mixing up server side controls and Silverlight, the server side controls will cause postbacks that will refresh the Silverlight control. To avoid that problem, the developer may want to use MS ASP.NET AJAX to avoid the server side controls from doing a postback using the UpdatePanel. For this to work there is a simple modification that you need to do at the page where you are hosting the Silverlight control.&lt;/p&gt;  &lt;p&gt;First drag and drop the ScriptManager on the page.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_07B80599.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="59" alt="image" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_151E189F.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Second replace the location of the Silverlight.js file from:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&amp;lt;script type=&lt;span class="str"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; src=&lt;span class="str"&gt;&amp;quot;Silverlight.js&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;To be hosted inside the ScriptManager like this:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&amp;lt;asp:ScriptManager ID=&lt;span class="str"&gt;&amp;quot;ScriptManager1&amp;quot;&lt;/span&gt; runat=&lt;span class="str"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&amp;gt;
        &amp;lt;Scripts&amp;gt;
           &amp;lt;asp:ScriptReference Path=&lt;span class="str"&gt;&amp;quot;Silverlight.js&amp;quot;&lt;/span&gt; /&amp;gt;
          &amp;lt;/Scripts&amp;gt;
         &amp;lt;/asp:ScriptManager&amp;gt;&lt;/pre&gt;

&lt;p&gt;Now all the controls hosted inside the UpdatePanels should work, remember not to add an UpdatePanel to wrap the Silverlight control. &lt;/p&gt;

&lt;p&gt;Happy Silverlighting.&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;

&lt;p&gt;Al&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/alpascual"&gt;Follow me in twitter&lt;/a&gt; | &lt;a href="http://silverlightme.net/"&gt;bookmark me&lt;/a&gt; | &lt;a href="http://alpascual.com/blog/al/rss.aspx"&gt;Subscribe to my feed&lt;/a&gt; | &lt;a href="http://mapStats.net"&gt;Add stats to your blog&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7184291" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term="AJAX" scheme="http://weblogs.asp.net/albertpascual/archive/tags/AJAX/default.aspx" /><category term="Silverlight 3" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Silverlight+3/default.aspx" /></entry><entry><title>How to enable Silverlight 3 to run out of the browser</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/08/27/how-to-enable-silverlight-3-to-run-out-of-the-browser.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/08/27/how-to-enable-silverlight-3-to-run-out-of-the-browser.aspx</id><published>2009-08-28T03:27:00Z</published><updated>2009-08-28T03:27:00Z</updated><content type="html">&lt;p&gt;Prior the release of Silverlight 3, the way to enable Silverlight to run out of the browser meant to edit the AppManifest.xml file and add this XML.&lt;span class="kwrd"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt; &amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Deployment.ApplicationIdentity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ApplicationIdentity&lt;/span&gt;
        &lt;span class="attr"&gt;ShortName&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Out of Browser Application&amp;quot;&lt;/span&gt;
        &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;This app is out of the browser!&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ApplicationIdentity.Blurb&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        Sample Out of the Browser App
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ApplicationIdentity.Blurb&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ApplicationIdentity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Deployment.ApplicationIdentity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Now that Silverlight 3 its being released, is much easier than that.&lt;/p&gt;

&lt;p&gt;Go to the Silverlight properties then the Silverlight tab, there is a check box called Enable running application out of the browser, you can enable that and a new button called Out-of-Browser Settings will appear to set how you want the application to look.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/Capture_0CCDF1FF.png"&gt;&lt;img title="Capture" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="242" alt="Capture" src="http://weblogs.asp.net/blogs/albertpascual/Capture_thumb_72F9BBCF.png" width="424" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;A new file will show up under properties called OutOfBrowserSettings.xml&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/Capture2_644F0FEA.png"&gt;&lt;img title="Capture2" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="85" alt="Capture2" src="http://weblogs.asp.net/blogs/albertpascual/Capture2_thumb_0AB0F336.png" width="219" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The XML generated will look like that:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;OutOfBrowserSettings&lt;/span&gt; &lt;span class="attr"&gt;ShortName&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Application&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;EnableGPUAcceleration&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;True&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;ShowInstallMenuItem&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;True&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;OutOfBrowserSettings.Blurb&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; Application on your desktop; at home, at work or on the go.&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;OutOfBrowserSettings.Blurb&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;OutOfBrowserSettings.WindowSettings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;WindowSettings&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot; Application&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;OutOfBrowserSettings.WindowSettings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;OutOfBrowserSettings.Icons&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;OutOfBrowserSettings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;You can change the values on the file or use the UI to do so.&lt;/p&gt;

&lt;p&gt;Happy coding.&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;

&lt;p&gt;Al&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/alpascual"&gt;Follow me in twitter&lt;/a&gt; | &lt;a href="http://silverlightme.net/"&gt;bookmark me&lt;/a&gt; | &lt;a href="http://alpascual.com/blog/al/rss.aspx"&gt;Subscribe to my feed&lt;/a&gt; | &lt;a href="http://mapStats.net"&gt;Add stats to your blog&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7182354" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term="Silverlight 3" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Silverlight+3/default.aspx" /></entry><entry><title>Attend the free event, take home Windows 7</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/08/26/attend-the-free-event-take-home-windows-7.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/08/26/attend-the-free-event-take-home-windows-7.aspx</id><published>2009-08-27T04:44:00Z</published><updated>2009-08-27T04:44:00Z</updated><content type="html">&lt;p&gt;These are the new innovations that can help you be part of the new efficiency. And at our free live events, you can learn, network, and get your copy of Windows 7!&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Register here:&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.microsoft.com/business/thenewefficiency/" href="http://www.microsoft.com/business/thenewefficiency/"&gt;http://www.microsoft.com/business/thenewefficiency/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Agenda&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;07:30 AM - 9:00 AM &lt;/p&gt;  &lt;h5&gt;Developer Event Registration &amp;amp; Continental Breakfast &lt;/h5&gt;  &lt;p&gt;09:00 AM - 11:35 AM &lt;/p&gt;  &lt;h5&gt;Optimizing Your Application For Windows 7&lt;/h5&gt; &lt;a href="http://www.microsoft.com/#"&gt;See More&lt;/a&gt;   &lt;p&gt;When running your application on Windows 7, do you feel it performs at its best? Do you want your application to shine on Windows 7 and give your users the comfort that comes with Windows 7 Taskbar and Libraries? This session can show you how to give your applications new functionality with very few code changes.&lt;/p&gt;  &lt;h5&gt;Creating New And Exciting Users Experiences – Part 1&lt;/h5&gt; &lt;a href="http://www.microsoft.com/#"&gt;See More&lt;/a&gt;   &lt;p&gt;Do you want to differentiate yourself from the competition? Do you want to be able to say, &amp;quot;Hi, my app brings extra value on Windows 7.&amp;quot; Then these sessions are for you! In the first of this two part series, you'll learn about these features and more: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Windows 7 Sensor and Location platform to optimize your mobile user's experiences &lt;/li&gt;    &lt;li&gt;Windows Touch at your fingertips &lt;/li&gt; &lt;/ul&gt;  &lt;h5&gt;Creating New And Exciting Users Experiences – Part 2&lt;/h5&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7182275" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term="Windows 7" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Windows+7/default.aspx" /></entry><entry><title>ArcGIS JavaScript API printing through PDF</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/08/06/arcgis-javascript-api-printing-through-pdf.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/08/06/arcgis-javascript-api-printing-through-pdf.aspx</id><published>2009-08-07T04:16:00Z</published><updated>2009-08-07T04:16:00Z</updated><content type="html">&lt;p&gt;Printing in REST? The most common question. The JavaScript API Team released this sample.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2009/07/27/ArcGIS-JavaScript-API-printing-through-PDF.aspx"&gt;The first API that serializes the information to allow a webservice to print the image&lt;/a&gt;. The webservice is java based and can be download it here. &lt;/p&gt;  &lt;p&gt;&lt;a title="http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=16432" href="http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=16432"&gt;http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=16432&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hope this helps&lt;/p&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Al&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/alpascual"&gt;Follow me in twitter&lt;/a&gt; | &lt;a href="http://silverlightme.net/"&gt;bookmark me&lt;/a&gt; | &lt;a href="http://alpascual.com/blog/al/rss.aspx"&gt;Subscribe to my feed&lt;/a&gt; | &lt;a href="http://mapStats.net"&gt;Add stats to your blog&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7162927" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term="ESRI" scheme="http://weblogs.asp.net/albertpascual/archive/tags/ESRI/default.aspx" /><category term="JavaScript" scheme="http://weblogs.asp.net/albertpascual/archive/tags/JavaScript/default.aspx" /></entry><entry><title>SQL 2008 CLR Triggers, use a .NET class library in SQL using WPF</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/07/27/sql-2008-clr-triggers-use-a-net-class-library-in-sql-using-wpf.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/07/27/sql-2008-clr-triggers-use-a-net-class-library-in-sql-using-wpf.aspx</id><published>2009-07-27T20:55:00Z</published><updated>2009-07-27T20:55:00Z</updated><content type="html">&lt;p&gt;Since SQL 2005 you can add .NET dlls into the SQL Assemblies, therefore get called on triggers and event from SQL to do something. Those should be simple utilities as the installation is still quite painful. &lt;/p&gt;  &lt;p&gt;Now when you are trying to use WCF or WPF dlls referenced on your application that could be a little harder.&lt;/p&gt;  &lt;p&gt;You’ll have to reference all the assemblies by hand that means setting the trust level .&lt;/p&gt;  &lt;p&gt;ALTER DATABASE DatabaseName SET TRUSTWORTHY OFF    &lt;br /&gt;use MASTER     &lt;br /&gt;GRANT UNSAFE ASSEMBLY to public &lt;/p&gt;  &lt;p&gt;Working with a DLL referencing WPF toolkit you first need all those:&lt;/p&gt;  &lt;p&gt;CREATE ASSEMBLY [SMDiagnostics]&amp;#160; FROM 'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\SMDiagnostics.dll'&amp;#160; WITH permission_set = unsafe    &lt;br /&gt;CREATE ASSEMBLY [System.Runtime.Serialization] AUTHORIZATION dbo FROM 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.Runtime.Serialization.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [System.Data.Linq] AUTHORIZATION dbo FROM 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.Linq.dll'&amp;#160; WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [System.Core] AUTHORIZATION dbo FROM 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\system.core.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [WindowsBase] AUTHORIZATION dbo FROM 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\windowsbase.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [PresentationCFFRasterizer] AUTHORIZATION dbo FROM 'C:\Windows\Microsoft.NET\Framework\v3.0\WPF\PresentationCFFRasterizer.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [System.Drawing] AUTHORIZATION dbo FROM 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [PresentationCore] AUTHORIZATION dbo FROM 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCore.dll' WITH permission_set = unsafe &lt;/p&gt;  &lt;p&gt;CREATE ASSEMBLY [PresentationHost] AUTHORIZATION dbo FROM 'C:\Windows\Microsoft.NET\Framework\v3.0\WPF\PresentationHostDLL.dll' WITH permission_set = unsafe &lt;/p&gt;  &lt;p&gt;CREATE ASSEMBLY [System.Windows.Forms] AUTHORIZATION dbo FROM 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll' WITH permission_set = unsafe    &lt;br /&gt;CREATE ASSEMBLY [System.DirectoryServices] AUTHORIZATION dbo FROM 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.DirectoryServices.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [PresentationFramework] AUTHORIZATION dbo FROM 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [PresentationUI] AUTHORIZATION dbo FROM 'C:\Windows\Microsoft.NET\Framework\v3.0\WPF\PresentationUI.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [System.Web] AUTHORIZATION dbo FROM 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Web.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [System.Messaging] AUTHORIZATION dbo FROM 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Messaging.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [System.IdentityModel] AUTHORIZATION dbo FROM 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.IdentityModel.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [System.IdentityModel.Selectors] AUTHORIZATION dbo FROM 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.IdentityModel.Selectors.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [System.ServiceModel] AUTHORIZATION dbo FROM 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll' WITH permission_set = unsafe     &lt;br /&gt;CREATE ASSEMBLY [Microsoft.Transactions.Bridge] AUTHORIZATION dbo FROM 'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\Microsoft.Transactions.Bridge.dll' WITH permission_set = unsafe &lt;/p&gt;  &lt;p&gt;CREATE ASSEMBLY [System.Web.Extensions] AUTHORIZATION dbo FROM 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll' WITH permission_set = unsafe &lt;/p&gt;  &lt;p&gt;CREATE ASSEMBLY [wpftoolkit] AUTHORIZATION dbo FROM 'C:\Program Files\WPF Toolkit\v3.5.40128.1\wpftoolkit.dll' WITH permission_set = unsafe &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now you are ready to add your dll into SQL&lt;/p&gt;  &lt;p&gt;CREATE ASSEMBLY YourDLLName    &lt;br /&gt;FROM 'C:\temp\YourDLLName.dll'&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Create a trigger to get called when there is a table insert.&lt;/p&gt;  &lt;p&gt;CREATE TRIGGER InsertTrigger    &lt;br /&gt;ON TableName     &lt;br /&gt;FOR INSERT     &lt;br /&gt;AS EXTERNAL NAME Assembly.Class.Method&lt;/p&gt;  &lt;p&gt;Of course you can add a trigger for update or delete.&lt;/p&gt;  &lt;p&gt;Preparation&lt;/p&gt;  &lt;p&gt;You’ll need to allow .NET CRL objects enabled on your SQL Database, to do that, please run:&lt;/p&gt;  &lt;p&gt;EXEC sp_configure 'clr enabled', 1;    &lt;br /&gt;RECONFIGURE WITH OVERRIDE;     &lt;br /&gt;GO&lt;/p&gt;  &lt;p&gt;Looks like is a little complicated, yet with a little SQL script and patience you can have a very powerful trigger that will call you C# dll on SQL events.&lt;/p&gt;  &lt;p&gt;A warning here is that there is no debugging or way to attach the debugger, so keep it simple or send the information to a WCF service.&lt;/p&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Al&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7139553" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term="CLR Triggers" scheme="http://weblogs.asp.net/albertpascual/archive/tags/CLR+Triggers/default.aspx" /><category term="SQL" scheme="http://weblogs.asp.net/albertpascual/archive/tags/SQL/default.aspx" /><category term="Triggers" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Triggers/default.aspx" /></entry><entry><title>How to use the SQL 2008 Geometry.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/07/20/how-to-use-the-sql-2008-geometry.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/07/20/how-to-use-the-sql-2008-geometry.aspx</id><published>2009-07-21T04:53:00Z</published><updated>2009-07-21T04:53:00Z</updated><content type="html">&lt;p&gt;Playing a little with SQL 2008 geometry I thought to post the queries that insert point, lines and polygons for the world to copy and paste if you like &lt;/p&gt;  &lt;p&gt;INSERT INTO [Test].[dbo].[GeometryTest]    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ([Name]     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ,[Shape])     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VALUES     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ('Test'     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ,'POLYGON ((5 4, 5.38924515247345 4.0785849690437317, 5.70710676908493 4.29289323091507, 5.9214150309562683 4.61075484752655, 6 5, 5.9214150309562683 5.38924515247345, 5.70710676908493 5.70710676908493, 5.38924515247345 5.9214150309562683, 5 6, 4.61075484752655 5.9214150309562683, 4.29289323091507 5.70710676908493, 4.0785849690437317 5.38924515247345, 4 5, 4.0785849690437317 4.61075484752655, 4.29289323091507 4.29289323091507, 4.61075484752655 4.0785849690437317, 5 4))')     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;or &lt;/p&gt;  &lt;p&gt;Adding a Spatial Reference to the polygon with automatic convertion.&lt;/p&gt;  &lt;p&gt;INSERT INTO [Test].[dbo].[GeometryTest] values ('Polygon2', geometry::STGeomFromText(    &lt;br /&gt;'POLYGON((-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))', 4326));&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;INSERT INTO [Test].[dbo].[GeometryTest] values ('Line', geometry::STGeomFromText(    &lt;br /&gt;'LINESTRING(-122.34799999 47.648999999, -122.34799999999814 47.658000000054017, -122.35 47.65800, -122.35800000000745 47.652999999932945, -123.999 44.999)', 4326));&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Create a buffer from a geometry&lt;/p&gt;  &lt;p&gt;SELECT&amp;#160;&amp;#160;&amp;#160;&amp;#160; TOP (1) Shape.STBuffer(0.001) AS Expr1    &lt;br /&gt;FROM&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dbo.GeometryTest&lt;/p&gt;  &lt;p&gt;Get a centroid&lt;/p&gt;  &lt;p&gt;SELECT&amp;#160;&amp;#160;&amp;#160;&amp;#160; TOP (1) Shape.STCentroid() AS Expr1    &lt;br /&gt;FROM&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dbo.GeometryTest&lt;/p&gt;  &lt;p&gt;Get the boundary&lt;/p&gt;  &lt;p&gt;SELECT&amp;#160;&amp;#160;&amp;#160;&amp;#160; TOP (1) Shape.STBoundary() AS Expr1    &lt;br /&gt;FROM&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dbo.GeometryTest&lt;/p&gt;  &lt;p&gt;Resources&lt;/p&gt;  &lt;p&gt;&lt;a title="http://technet.microsoft.com/en-us/magazine/2008.04.datatypes.aspx?pr=blog" href="http://technet.microsoft.com/en-us/magazine/2008.04.datatypes.aspx?pr=blog"&gt;http://technet.microsoft.com/en-us/magazine/2008.04.datatypes.aspx?pr=blog&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://technet.microsoft.com/en-us/library/bb933985.aspx" href="http://technet.microsoft.com/en-us/library/bb933985.aspx"&gt;http://technet.microsoft.com/en-us/library/bb933985.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://sqlspatialtools.codeplex.com/Wiki/View.aspx?title=Current%20Contents" href="http://sqlspatialtools.codeplex.com/Wiki/View.aspx?title=Current%20Contents"&gt;http://sqlspatialtools.codeplex.com/Wiki/View.aspx?title=Current%20Contents&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7149785" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term="SQL" scheme="http://weblogs.asp.net/albertpascual/archive/tags/SQL/default.aspx" /></entry><entry><title>Family green vacation in Mexico without sacrificing luxury.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/07/20/family-green-vacation-in-mexico-without-sacrificing-luxury.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/07/20/family-green-vacation-in-mexico-without-sacrificing-luxury.aspx</id><published>2009-07-20T14:34:00Z</published><updated>2009-07-20T14:34:00Z</updated><content type="html">&lt;p&gt;&lt;img style="display: inline; margin: 0px 20px 10px 0px" src="http://www.hotels.com/hotels/CUN_HATR-exter-1.jpg" align="left" /&gt; Once a year I completely escape with my family to a place without any possible connection to the Internet or computers, well actually we take a little laptop in the small chance to get some Internet connection and of course to play the kids DVDs on the plane. This year we are going to South Cancun, Mexico. We had many vacations in Mexico, all in Puerto Vallarta, a place my family enjoyed during the years. This time we are going to the other side of the country to a resort located at the Ecological Park.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline; margin: 0px 20px 0px 0px" src="http://www.e-travelsolution.com/_lib/vimages/Riviera_Maya/Hotels/Hacienda-Tres-Rios/Fachada.jpg" align="left" /&gt;&lt;/p&gt;  &lt;p&gt;After a long year of working hard in many projects, I found a beach all inclusive vacations with my wife and kids is all I need to catch up with life again. &lt;/p&gt;  &lt;p&gt;This resort called The &lt;a href="http://haciendatresrios.com/"&gt;Hacienda Tres Rios&lt;/a&gt; is a new resort of many that will be build in that Ecological Park, located on 326 acres of the Riviera Maya’s jungle, there are 3 natural rivers surrounding the resort for kayaking and providing fresh water. This resort is a model for environmentally sustainable tourism. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline; margin: 0px 20px 0px 0px" height="165" src="http://www.askabouthoneymoons.com/adimages/AAH/Tres Rios/table alone.jpg" width="248" align="left" /&gt; Tres Rios fulfills all environmental standards, reusing the natural resources without impacting the exceptional beauty around it. The AC heat is reused to heat the water in your shower for example. For all that, my family believes that could be a great place for us to spend 2 weeks enjoying their natural park and bird sanctuary with botanical garden.&lt;/p&gt;  &lt;p&gt;These kind of vacations allows me to spend 24 hours with my kids and play with them, something that with my busy schedule during the year I can only enjoy on weekends. We also are planning to enjoy and visit many Maya ruins and get into the culture.&lt;/p&gt;  &lt;p&gt;Being able to speak Spanish allow us to travel and get to know more details about the places we go in Mexico, my family and I enjoy that country and its people quite a lot. &lt;/p&gt;  &lt;p&gt;We have taken vacation to Grand Cayman, Thailand, Europe and Hawaii, still Mexico is one of our favorite destinations to go, to be honest we like the direct short flights, a must when traveling with kids, the friendly people, the awesome resorts and the great food. &lt;/p&gt;  &lt;p&gt;If you are planning a family vacation and I would encourage you to look and environmentally friendly resorts like this one.&lt;/p&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Al &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7139538" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author><category term="Mexico" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Mexico/default.aspx" /><category term="Random Thoughts" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Random+Thoughts/default.aspx" /><category term="Vacation" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Vacation/default.aspx" /></entry></feed>