<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Why Can&#039;t You Code? &#187; ria services</title>
	<atom:link href="http://www.whycantyoucode.com/category/ria-services/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.whycantyoucode.com</link>
	<description>The highest form of ignorance is when you reject something you don&#039;t know anything about.</description>
	<lastBuildDate>Thu, 25 Feb 2010 14:39:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Verbose steps to migrate a Silverlight application from .NET RIA Services (July 09) to WCF RIA Services (PDC 09)</title>
		<link>http://www.whycantyoucode.com/2009/11/verbose-steps-to-migrate-a-silverlight-application-from-net-ria-services-july-09-to-wcf-ria-services-pdc-09/</link>
		<comments>http://www.whycantyoucode.com/2009/11/verbose-steps-to-migrate-a-silverlight-application-from-net-ria-services-july-09-to-wcf-ria-services-pdc-09/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 19:25:00 +0000</pubDate>
		<dc:creator>Andrei Alecu</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ria services]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.whycantyoucode.com/?p=134</guid>
		<description><![CDATA[These are the steps I had to go through to migrate a Silverlight application that was running on the .NET RIA Services preview released in July 09, to the new WCF RIA Services released during PDC 09: Delete all HttpHandler references to DataService.axd from your web.config. Basically, these two need to go: &#60;system.webServer&#62; ... &#60;handlers&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>These are the steps I had to go through to migrate a <strong>Silverlight</strong> application that was running on the .NET RIA Services preview released in July 09, to the new <strong>WCF</strong> RIA Services released during PDC 09:</p>
<ol>
<li>Delete all HttpHandler references to DataService.axd from your web.config. Basically, these two need to go:
<pre class="brush: xml; ruler: true; smart-tabs: false;">&lt;system.webServer&gt;
  ...
  &lt;handlers&gt;
    ...
    &lt;add name=&quot;DataService&quot; verb=&quot;GET,POST&quot; path=&quot;DataService.axd&quot; type=&quot;System.Web.Ria.DataServiceFactory, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot; /&gt;
  &lt;/handlers&gt;
&lt;/system.webServer&gt;</pre>
<pre class="brush: xml; ruler: true; smart-tabs: false;">&lt;httpHandlers&gt;
  ...
  &lt;add path=&quot;DataService.axd&quot; verb=&quot;GET,POST&quot; type=&quot;System.Web.Ria.DataServiceFactory, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot; validate=&quot;false&quot; /&gt;
&lt;/httpHandlers&gt;</pre>
</li>
<li>Add/update your web.config along the lines of:
</p>
<p>.NET 3.5:</p>
<pre class="brush: xml; ruler: true; smart-tabs: false;">&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;configuration&gt;
  &lt;system.web&gt;
    &lt;httpModules&gt;
      &lt;add name=&quot;DomainServiceModule&quot; type=&quot;System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria,Version=2.0.0.0,Culture=neutral,PublicKeyToken=31BF3856AD364E35&quot;/&gt;
    &lt;/httpModules&gt;
  &lt;/system.web&gt;
  &lt;system.webServer&gt;
    &lt;modules&gt;
      &lt;add name=&quot;DomainServiceModule&quot; preCondition=&quot;managedHandler&quot; type=&quot;System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria,Version=2.0.0.0,Culture=neutral,PublicKeyToken=31BF3856AD364E35&quot;/&gt;
    &lt;/modules&gt;
  &lt;system.webServer&gt;
  &lt;system.serviceModel&gt;
    &lt;serviceHostingEnvironment aspNetCompatibilityEnabled=&quot;true&quot;/&gt;
  &lt;/system.serviceModel&gt;
&lt;/configuration&gt;</pre>
<p>.NET 4.0: </p>
<p></p>
<pre class="brush: xml; ruler: true; smart-tabs: false;">&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;configuration&gt;

  &lt;system.web&gt;
    &lt;httpModules&gt;
      &lt;add name=&quot;DomainServiceModule&quot; type=&quot;System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot; /&gt;
    &lt;/httpModules&gt;
    &lt;compilation debug=&quot;true&quot; targetFramework=&quot;4.0&quot; /&gt;
  &lt;/system.web&gt;

  &lt;system.webServer&gt;
    &lt;validation validateIntegratedModeConfiguration=&quot;false&quot;/&gt;
    &lt;modules runAllManagedModulesForAllRequests=&quot;true&quot;&gt;
      &lt;add name=&quot;DomainServiceModule&quot; preCondition=&quot;managedHandler&quot;
          type=&quot;System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot; /&gt;
    &lt;/modules&gt;
    &lt;validation validateIntegratedModeConfiguration=&quot;false&quot; /&gt;
  &lt;/system.webServer&gt;

  &lt;system.serviceModel&gt;
    &lt;serviceHostingEnvironment aspNetCompatibilityEnabled=&quot;true&quot; /&gt;
  &lt;/system.serviceModel&gt;
&lt;/configuration&gt;</pre>
</li>
<li>If you’re throwing <strong>DomainServiceException</strong>, take note that the class has been renamed to <strong>DomainException</strong>. Update your code accordingly. </li>
<li>Remove any reference you may have to <strong>System.Web.DomainServices.Providers.dll</strong>, you will need to add a new reference to either <strong>System.Web.DomainServices.EntityFramework.dll</strong> or <strong>System.Web.DomainServices.LinqToSql.dll</strong> depending on what you use. </li>
<li>Change this:
<pre class="brush: csharp; ruler: true; gutter: false; toolbar: false; smart-tabs: false;">using System.Web.DomainServices.LinqToEntities;</pre>
<p>To this:</p>
<pre class="brush: csharp; ruler: true; gutter: false; toolbar: false; smart-tabs: false;">using System.Web.DomainServices.Providers;</pre>
<p>Everywhere.</p>
</li>
<li>The DomainService.<strong>Context </strong>property has been renamed to <strong>ObjectContext</strong>. Update all your code accordingly.
<p>&#160;</p>
<p><strong>Now, your Web application should build, but you may still get this error while building the actual Silverlight application:</strong></p>
<pre>Error    5    The &quot;CreateRiaClientFilesTask&quot; task failed unexpectedly.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.InvalidOperationException: The AutoGenerateField property has not been set.  Use the GetAutoGenerateField method to get the value.
   at System.ComponentModel.DataAnnotations.DisplayAttribute.get_AutoGenerateField()</pre>
<p>In my case, this was a problem with <strong>the System.ComponentModel.DataAnnotations.dll</strong> reference. Remove it and re-add it from the <strong>Global Assembly Cache</strong>. </p>
</li>
<li>Remove the reference to <strong>System.Windows.Ria.Controls.dll </strong>and add one to <strong>System.Windows.Controls.Ria.dll</strong>. </li>
<li>You will need to update your XAML to reference the new assembly:
<p>Replace <strong>System.Windows.Ria.Controls</strong> with <strong>System.Windows.Controls.Ria</strong> in your namespace declarations in the header of the XAML file. Here’s how the old ones look:</p>
<pre class="brush: xml; ruler: true; gutter: false; toolbar: false; smart-tabs: false;">xmlns:riaControls=&quot;clr-namespace:System.Windows.Controls;assembly=System.Windows.Ria.Controls&quot; xmlns:System_Windows_Data=&quot;clr-namespace:System.Windows.Data;assembly=System.Windows.Ria.Controls&quot;</pre>
</li>
<li><strong>RiaContext </strong>(.Current) has been renamed to <strong>WebContextBase</strong>. It’s in the System.Windows.Ria namespace. </li>
<li><strong>The System.Windows.Ria.Data</strong> namespace has been removed. So make sure to remove it from your <strong>usings</strong> also. </li>
<li><strong>RiaContext.Current.User</strong> is now <strong>WebContextBase.Current.Authentication.User</strong> </li>
<li>In XAML, the namespace for the <strong>ControlParameter</strong> type has changed to <strong>System.Windows.Controls</strong> from <strong>System.Windows.Data</strong>, update accordingly. </li>
<li>If you use Forms Authentication, update the <strong>RiaContext</strong> reference in <strong>App.xaml</strong> to a <strong>WebContext</strong> reference such as:
<pre class="brush: xml; ruler: true; smart-tabs: false;">&lt;Application.ApplicationLifetimeObjects&gt;
    &lt;app:WebContext&gt;
        &lt;app:WebContext.Authentication&gt;
            &lt;appsvc:FormsAuthentication/&gt;
            &lt;!--&lt;appsvc:WindowsAuthentication/&gt;--&gt;
        &lt;/app:WebContext.Authentication&gt;
    &lt;/app:WebContext&gt;
&lt;/Application.ApplicationLifetimeObjects&gt;</pre>
</li>
</ol>
<p>With some luck, your project should be migrated to WCF RIA Services now. These were the steps I needed to get mine working.</p>
<p>Additional breaking changes in the new release can be found <a href="http://code.msdn.microsoft.com/RiaServices/Release/ProjectReleases.aspx?ReleaseId=3570" target="_blank">here</a>.</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.whycantyoucode.com/2009/11/verbose-steps-to-migrate-a-silverlight-application-from-net-ria-services-july-09-to-wcf-ria-services-pdc-09/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

