<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : New Silverlight &quot;Business Application&quot; templates shipped with v6.0.6</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : New Silverlight &quot;Business Application&quot; templates shipped with v6.0.6</description>
  <pubDate>Wed, 29 Jul 2026 06:14:37 -700</pubDate>
  <lastBuildDate>Wed, 20 Oct 2010 15:30:01 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2250</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>New Silverlight &quot;Business Application&quot; templates shipped with v6.0.6 : The 6.0.6 release contains newSilverlight...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2250&amp;PID=8859#8859</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=477" rel="nofollow">ting</a><br /><strong>Subject:</strong> 2250<br /><strong>Posted:</strong> 20-Oct-2010 at 3:30pm<br /><br /><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><p>The 6.0.6 release contains new&nbsp;Silverlight "Business Application" project templates.&nbsp;&nbsp;These templates are similar to the templates you may have seen or used with Microsoft RIA Services:&nbsp; the same navigation and theming are used, but we've implemented user authentication and registration using DevForce.&nbsp; As with the standard DevForce Silverlight Application template, all DevForce references are already set, and the web.config, global.asax and default.aspx are configured as you would see in the standard application.&nbsp; You should be all set to add an Entity Model and start coding, but here's more information to get you started.</p><div><u>ASP.NET Security and SQL Express</u></div><div><u></u>&nbsp;</div><div><strong>The user authentication and registration pieces are using ASP.NET Security services</strong>&nbsp;(Membership, Profile and Roles).&nbsp; These default to using a&nbsp;<strong>SQL Express</strong>&nbsp;database.&nbsp; If you'd like to use your SQL 2008 (or 2005) database instead, you have a few options:</div><ul style="list-style-: circle; "><li>Modify the web.config to specify a correct LocalSqlServer connection string.&nbsp; For example:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;connectionStrings&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;remove name="LocalSqlServer" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add name="LocalSqlServer" connectionString="data source=.;Integrated Security=SSPI;Initial Catalog=aspnetdb;" providerName="System.Data.SqlClient"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/connectionStrings&gt;</li><li>Modify your machine.config to re-point the LocalSqlServer connection string defined there to your SQL Server.&nbsp; If you're going to take this step we assume you know what you're doing, so we won't offer any further&nbsp;instruction here.&nbsp;</li></ul><p><u>Where to get the database?</u>&nbsp;&nbsp;</p><div>We've got a sample used with our Silverlight Security samples, which you can find here:<a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/Code_ASPNETMembershipAndRoles" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/Code_ASPNETMembershipAndRoles</a><br>You can also build one from scratch with Microsoft' guidance:&nbsp;&nbsp;<a href="http://msdn.microsoft.com/en-us/library/x28wfk74.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/x28wfk74.aspx</a></div><p><strong><font color="#ff0066">Note</font></strong>&nbsp;if you attempt to login or register a new user and you do not have SQL Express, and have not made the above changes, then these actions will&nbsp;<u>fail</u>.&nbsp; Depending on what you're doing you'll likely get a "Provider failed on open" error.&nbsp; If you would like to use the BAT without the login processing, or with your own login logic, you can make the appropriate modifications.&nbsp; Continue reading for a description of the BAT contents, and contact us if you have any questions.</p><div><u>How do these templates compare with those from RIA Services?</u></div><ul style="list-style-: circle; "><li>What's the same</li><ul style="list-style-: circle; "><li>All of the assets and resources are unchanged, as well as helpers, controls, and libs.&nbsp; Themes, navigation, and basic functionality are the same.</li></ul><li>What's different</li><ul style="list-style-: circle; "><li>app.xaml code-behind now adds the AuthenticationManager.Current to application resources, and does a "LoadUser" call to try to obtain existing credentials (when using Windows authentication, or&nbsp;a persistent cookie from another Forms authenticated session exists).&nbsp; The current user is always accessible via AuthenticationManager.Current.User.</li><li>The primary area of change is in the Login model and views:</li><ul style="list-style-: circle; "><li>The LoginInfo and RegistrationData classes are still in the Model, but they're now simple types (they are not DevForce&nbsp;entities) backed by a simple base class performing DevForce validation for property setters.&nbsp;</li><li>The views should all look and function the same.&nbsp; We replaced much of the logic scattered between the code-behind and the entities&nbsp;in the RIA templates with simple view models to make modifications easier.</li></ul></ul><li>What's new</li></ul><blockquote dir="ltr" style="margin-right: 0px; "><p>The AuthenticationManager in the Silverlight project, and the RegistrationServices in the web project, handle login and new user registration.&nbsp;</p><p dir="ltr">In DevForce, every EntityManager must be "logged in" in order to communicate with the BOS or access the data source: if you don't call Login (or otherwise provide credentials), then DevForce will do an "implicit" login for you, usually resulting in a guest login.&nbsp; If your application uses multiple EntityManagers you likely gather credentials once, and then use the EntityManager copy constructor or its LinkForAuthentication method to "pass the credentials around", so that each EM does not need to re-login.&nbsp; (What's passed around is actually a token, called the SessionBundle, not the actual login credentials.)</p><div dir="ltr">The AuthenticationManager helps alleviate this extra work, via its implementation of the new&nbsp;<em>IAuthenticationManager</em>interface.&nbsp; DevForce will automatically search for an implementation of this interface, and if found use it whenever implicit login is needed.&nbsp; As shown in the template, you can gather credentials and login once using the AuthenticationManager, and any other EntityManager you use within your application will obtain its credentials via the AuthenticationManager in its LinkAuthentication method.</div><p dir="ltr">If you're interested in the new&nbsp;<strong>Coroutine</strong>&nbsp;support in DevForce (and if you're not you should be!), you'll find two easy to digest uses of it in the AuthenticationManager's Login and RegisterUser methods.</p><p dir="ltr" style="margin-right: 0px; ">The RegistrationServices class in the web project holds an RPC method called CreateUser which is called from the client to perform new user registration.&nbsp; The CreateUser logic uses ASP.NET services to register the new user.&nbsp; Since you'll likely have your own roles and Profile information, you'll need to modify this logic for your needs.</p></blockquote><p><u>Troubleshooting</u></p><ul style="list-style-: circle; "><li>There's a User class defined which extends the DevForce UserBase&nbsp; to add a sample ASP.NET Profile property.&nbsp; Beware of type name collisions if you add an Entity Model which also contains a "User" class.&nbsp; (As an example, NorthwindIB includes a User table.)&nbsp; The User class here is defined in the Models subfolder, but you can always move or rename either the namespace or the class, or get rid of it altogether if you don't need to extend the base class.</li><li>The AuthenticationManager used in the Silverlight application to provide common login and registration functions is using an EntityManager under the hood. DevForce will always make the first EntityManager created the "Default" manager.&nbsp; If your code is using the DefaultManager static (and you really shouldn't) then be sure to set the DefaultManager to your own sub-classed EntityManager.&nbsp; If you don't, you'll be wondering where all those handy "entity set" queries have gone.</li></ul><p>We don't yet have VB versions of these templates, but will in the 6.0.7 release.</p><p><br></p></span>]]>
   </description>
   <pubDate>Wed, 20 Oct 2010 15:30:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2250&amp;PID=8859#8859</guid>
  </item> 
 </channel>
</rss>