<?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-08-27T20:27:00Z</updated><entry><title>A vampire’s week in Vienna Austria.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/11/19/a-vampire-s-week-in-vienna-austria.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/11/19/a-vampire-s-week-in-vienna-austria.aspx</id><published>2009-11-19T16:41:46Z</published><updated>2009-11-19T16:41:46Z</updated><content type="html">&lt;p&gt;I spent a week in Vienna Austria without seeing the sun light besides through the windows of a conference room. Sad to say yet this is what happens when you travel for work. Always seems so exciting for go International travelling, all the plans you make and all the idea of being in a foreign country with somebody else paying the bill, yet is never the case, all plans give way to long hours of work, and trying to keep jet lag on check that is never easy.&lt;/p&gt;  &lt;p&gt;I did go to visit the city at night with the excuse of going for dinner and a beer, everything I wanted to see like the Mozart house he stayed while in Vienna was already close as well as the Opera House. I added a little gallery for you to see my adventures in the dark of the Vienna night. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/2kri1_6994502D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="2kri[1]" border="0" alt="2kri[1]" align="left" src="http://weblogs.asp.net/blogs/albertpascual/2kri1_thumb_6DBE27F2.jpg" width="184" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/b1h1_571BD9AB.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="b1h[1]" border="0" alt="b1h[1]" align="left" src="http://weblogs.asp.net/blogs/albertpascual/b1h1_thumb_2875AAFC.jpg" width="244" height="184" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/f391_786B597A.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="f39[1]" border="0" alt="f39[1]" src="http://weblogs.asp.net/blogs/albertpascual/f391_thumb_4F14117C.jpg" width="184" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/jitk1_6254C81B.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="jitk[1]" border="0" alt="jitk[1]" align="left" src="http://weblogs.asp.net/blogs/albertpascual/jitk1_thumb_18E27360.jpg" width="244" height="184" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/509v1_1E50E404.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="509v[1]" border="0" alt="509v[1]" align="left" src="http://weblogs.asp.net/blogs/albertpascual/509v1_thumb_6DDA5F8D.jpg" width="244" height="184" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/st91_059196F4.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="st9[1]" border="0" alt="st9[1]" src="http://weblogs.asp.net/blogs/albertpascual/st91_thumb_5F4F3D9B.jpg" width="184" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Lucky enough the last day, I was able to see the city on board of a car driving around the city just an hour before going to the airport. I would give anything to have the time to stop at the huge museums in the center of Vienna and roam around at my own pace. This is a great town fun of history and architecture. Still the size around the historic parts of Vienna grows by miles, creating another big European metropolitan area. &lt;/p&gt;  &lt;p&gt;Checking twitter for news about Silverlight 4 I found out &lt;a href="http://weblogs.asp.net/scottgu"&gt;@scottgu&lt;/a&gt; is coming to Europe just now that I’m leaving, well off to London now!&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=7260597" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author></entry><entry><title>Silverlight 4 all about Media, Business Applications and calling your COM objects as trusted application!</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/11/18/silverlight-4-all-about-media-business-applications-and-calling-your-com-objects-as-trusted-application.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/11/18/silverlight-4-all-about-media-business-applications-and-calling-your-com-objects-as-trusted-application.aspx</id><published>2009-11-18T21:32:39Z</published><updated>2009-11-18T21:32:39Z</updated><content type="html">&lt;p&gt;Had to stream the PDC from Vienna, Austria, that was pretty cool that Microsoft gave that feed for people that didn’t make it to the PDC this year, yet I lost the chance to get my free laptop.&lt;/p&gt;  &lt;p&gt;Silverlight Beta is OUT! Announced at the &lt;a href="http://microsoftpdc.com/"&gt;PDC 2009&lt;/a&gt;. This is the present &lt;a href="http://weblogs.asp.net/blogs/scottgu"&gt;Scott Guthrie&lt;/a&gt; took out of his pocket as well as 3 iPhones. &lt;/p&gt;  &lt;p&gt;Silverlight 4 looks so amazing, the release candidate and hardware acceleration with now being able to get out of the browser with trusted support, means you can create a Silverlight 4 application that can be installed on the clients computer and run trusted to access the local system and call COM components. So Silverlight 4 can call ArcObjects if you hosting the ArcGIS Server in that machine? Or can you call a remote COM object?&lt;/p&gt;  &lt;p&gt;Enhancements in no specific order.&lt;/p&gt;  &lt;ul&gt;   &lt;ul&gt;     &lt;li&gt;Implicit Styles &lt;/li&gt;      &lt;li&gt;Drag and Drop &lt;/li&gt;      &lt;li&gt;Bidi &amp;amp; RTL &lt;/li&gt;      &lt;li&gt;HTML control, so why not hosting flash in Silverlight? &lt;/li&gt;      &lt;li&gt;.NET RIA Services &lt;/li&gt;      &lt;li&gt;Print support with a print API. &lt;/li&gt;      &lt;li&gt;Drag and drop files from the OS to Silverlight to upload &lt;/li&gt;      &lt;li&gt;Use your right mouse button. &lt;/li&gt;      &lt;li&gt;Out of the box now with trusted support &lt;/li&gt;      &lt;li&gt;Call COM objects from Silverlight 4. &lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://www.silverlight.net/getstarted/silverlight-4-beta/"&gt;Download Silverlight 4 Beta.&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.silverlight.net/getstarted/silverlight-4-beta/"&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_0812C2CE.png" width="244" height="195" /&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;strong&gt;Installing Silverlight 4 Beta with Silverlight 3&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Make sure you remove the Silverlight 3 Runtime before installing VS2010 that will install a new Silverlight 3 Runtime with a newer project.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/amyd/archive/2009/10/21/visual-studio-2010-and-silverlight-3-sdk.aspx" href="http://blogs.msdn.com/amyd/archive/2009/10/21/visual-studio-2010-and-silverlight-3-sdk.aspx"&gt;http://blogs.msdn.com/amyd/archive/2009/10/21/visual-studio-2010-and-silverlight-3-sdk.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Getting started with Silverlight 4.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.silverlight.net/getstarted/silverlight-4-beta/" href="http://www.silverlight.net/getstarted/silverlight-4-beta/"&gt;http://www.silverlight.net/getstarted/silverlight-4-beta/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9fa8afe9-cad6-4090-a7f6-7d9cdc560e2d&amp;amp;displaylang=en"&gt;Microsoft Silverlight 4 Tools for Visual Studio 2010 Beta 2&lt;/a&gt;&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=7259610" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author></entry><entry><title>The ArcGIS API for Microsoft Silverlight™/WPF™ version 1.1 is now available.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/11/17/the-arcgis-api-for-microsoft-silverlight-wpf-version-1-1-is-now-available.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/11/17/the-arcgis-api-for-microsoft-silverlight-wpf-version-1-1-is-now-available.aspx</id><published>2009-11-17T17:21:11Z</published><updated>2009-11-17T17:21:11Z</updated><content type="html">&lt;p&gt;Great news this morning, the new ESRI API for Silverlight when up on the &lt;a href="http://resources.esri.com/arcgisserver/apis/silverlight/"&gt;Resource Center&lt;/a&gt;. This is the build I have been waiting for, the biggest change I think is the added Map Viewer that you can personalize quite easily using Expression Blend. Below I added as a background image my ugly picture.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_4AE3A538.png"&gt;&lt;img style="border-right-width: 0px; margin: 0px 20px 15px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="left" src="http://weblogs.asp.net/blogs/albertpascual/image_thumb_136D6E3D.png" width="235" height="343" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160; Also is comes out with Action and Behaviors to enrich your objects by just dragging it and allows you to add interactivity without writing any code. You can find them all under your Assets in Expression Blend.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_1AC92DEA.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_6DD3CB0E.png" width="244" height="166" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I would suggest that if you haven’t used &lt;a href="http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/help/Expression_Getting_Started.htm"&gt;Expression Blend much to read this great paper to get started personalizing&lt;/a&gt; your Map Viewer.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Version 1.1 was released November 2009 (build 97). See the &lt;a href="http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/help/Whats_New.htm"&gt;What's New&lt;/a&gt; document for more details&lt;/p&gt;  &lt;p&gt;Enjoy!&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;p&gt;&lt;font size="2" face="Vijaya"&gt;None of my opinions reflects opinions or views by my employer. This is just my personal blog that is provided &amp;quot;AS IS&amp;quot; with no warranties and confer no rights. The postings on this site are my own and don’t necessarily represent ESRI’s positions, strategies or opinions.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7258107" 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="Silverlight 3" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Silverlight+3/default.aspx" /></entry><entry><title>Upgrading to Windows 7 complicated story.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/11/16/upgrading-to-windows-7-complicated-story.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/11/16/upgrading-to-windows-7-complicated-story.aspx</id><published>2009-11-17T03:27:00Z</published><updated>2009-11-17T03:27:00Z</updated><content type="html">&lt;p&gt;The most waited OS from Microsoft is here without any doubt, now you can find many blogs reviewing Windows 7 and everybody is giving the new OS a good review I believe, of course you can also find the radicals and the never happy people, yet in my modest opinion a good release for Microsoft all said and done. Yet there is something that does not complete the story.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/windows7logo1_63B2DD91.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px 15px 5px 10px; display: inline; border-top: 0px; border-right: 0px" title="windows-7-logo[1]" border="0" alt="windows-7-logo[1]" align="left" src="http://weblogs.asp.net/blogs/albertpascual/windows7logo1_thumb_1465E53D.jpg" width="109" height="91" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;When you purchase a operating system, you want a simple upgrading path, just go to a store and get your upgrade. Something that Apple did great with Snow Leopard, go home and upgrade your old operating system to what you just purchased. Microsoft had to add many version of the same operating system, that is ok by itself, yet you need to purchase the update that will let you install with your existing OS, whatever is Vista Professional or XP Professional. So if you purchase Windows 7 Ultimate you won’t be able to upgrade your XP Professional.&lt;/p&gt;  &lt;p&gt;So Microsoft had to make it a little more complicated from that point and I still wonder why. Just let the user purchase one media for upgrade, detect what the user has and do the upgrade from there. But wait, there is more! Now the story still gets more complicated, for users that want to format the whole hard disk before installing the new upgrade the upgrade disk won’t detect the existing media to recognize you have the right to do an upgrade. In that case, I personally recommend to finish the installation before adding your license number and when complete you can go to the Start Menu and type license, open the license manager and enter your license, Windows 7 shall ask you to call Microsoft to &lt;/p&gt;  &lt;p&gt;There are many users that want to format the hard disk to add a new operating system, and this is actually the recommended way, you really want to get rid of everything and let Windows 7 take care of installing itself cleaner that leaving other OS dlls on your hard disk.&lt;/p&gt;  &lt;p&gt;Below is a fantastic &lt;a href="http://www.winsupersite.com/win7/review_upgrade.asp"&gt;table created by Paul Thurrott&lt;/a&gt; to understand why upgrading path you need.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/albertpascual/image_4F4D1806.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_0B4933EF.png" width="318" height="466" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Thanks Paul in creating this table, will make lots of users very successful in their plan to upgrade to Windows 7.&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=7256828" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author></entry><entry><title>The ESRI Dev Summit 2010 hosted in Palms Springs CA is open for registration.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/albertpascual/archive/2009/10/30/the-esri-dev-summit-2010-hosted-in-palms-springs-ca-is-open-for-registration.aspx" /><id>http://weblogs.asp.net/albertpascual/archive/2009/10/30/the-esri-dev-summit-2010-hosted-in-palms-springs-ca-is-open-for-registration.aspx</id><published>2009-10-31T03:30:00Z</published><updated>2009-10-31T03:30:00Z</updated><content type="html">&lt;p&gt;My favorite conference/summit is now open for registration. If you are a developer in GIS or even just getting into mapping and location, this is a must go. You’ll find how to use the ESRI Silverlight SDK, Flex, JavaScript and the new iPhone SDK. So many developers for the Apple iPhone with great knowledge of Objective-C and Cocoa are waiting for the ESRI iPhone SDK that will provide you with all the ArcGis online maps and functionality&amp;#160; to create your applications.&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.esri.com/events/devsummit/registration/registration.html"&gt;Registration&lt;/a&gt;&lt;/h3&gt;  &lt;h4&gt;What's Included&lt;/h4&gt;  &lt;ul&gt;   &lt;li&gt;All scheduled sessions &lt;/li&gt;    &lt;li&gt;Presummit seminars &lt;/li&gt;    &lt;li&gt;ESRI Showcase &lt;/li&gt;    &lt;li&gt;GIS Solutions EXPO and Social &lt;/li&gt;    &lt;li&gt;DevSummit party &lt;/li&gt;    &lt;li&gt;Monday, Tuesday, Wednesday, and Thursday’s continental breakfast, lunch, and beverage breaks &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;When?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;March 22-25, 2010&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.esri.com/Info/blogs/devsummit/archive/2009/10/20/registration-now-open.aspx"&gt;From the official announcement&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The &lt;a href="http://www.esri.com/devsummit"&gt;DevSummit&lt;/a&gt; is your event, and you won't want to miss it. It's the place to get your voice heard and your hands dirty. Ask questions and get into meaty discussions. When it comes to using spatial technology in your applications, this is your ultimate resource for the year, where you'll learn exactly how to build and deploy critical, cutting-edge solutions in your job. &lt;/p&gt;  &lt;p&gt;Are you a mapping or spatial application developer? A software architect interested in ArcGIS? Maybe you don't use ESRI software currently. Maybe you live halfway around the world from the California desert. It doesn't matter. You'll benefit greatly. &lt;/p&gt;  &lt;h3&gt;Need an excuse or to send an email to your boss?&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.esri.com/events/devsummit/index.html"&gt;Find all the information here.&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7243549" width="1" height="1"&gt;</content><author><name>albertpascual</name><uri>http://weblogs.asp.net/members/albertpascual.aspx</uri></author></entry><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="Silverlight 3" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Silverlight+3/default.aspx" /><category term=".NET RIA Service" scheme="http://weblogs.asp.net/albertpascual/archive/tags/.NET+RIA+Service/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="Silverlight 3" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Silverlight+3/default.aspx" /><category term=".NET RIA Service" scheme="http://weblogs.asp.net/albertpascual/archive/tags/.NET+RIA+Service/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="Silverlight 3" scheme="http://weblogs.asp.net/albertpascual/archive/tags/Silverlight+3/default.aspx" /><category term=".NET RIA Service" scheme="http://weblogs.asp.net/albertpascual/archive/tags/.NET+RIA+Service/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></feed>