Blog Search:
Lynergy Web Application Development Blog
Wednesday, September 29, 2010 Blog Post
0


Posted by Matt Hudson
Categories: Technical How To

So, the last two weeks have been pretty hectic.  We took our MSDN BizSpark license and setup Visual Studio 2010 and Team Foundation Server 2010 as well.  We're very excited about it.

Some things we learned: If you del

ete your Project Collection, you must also clear the configuration of your SharePoint site for that collection and for the Reporting Services collection.

Initially we started with TFS 2008.  If you do that, you must also start with SQL Server 2005, and Upgrade to TFS 2008 SP1, then to SQL Server 2008 or you will get stuck.  Luckily we discovered that we also had TFS 2010 and installed it with SQL Server 2008 R2.

When creating your instance of TFS 2010, make sure to create more than one user.  If each developer logs in with the same login, you'll run each other over.

We also set our Project Collection to not allow multiple users to check out items, because merging changes on small projects is a waste of time.

If you want to use custom authentication with Silverlight 4:

http://code.msdn.microsoft.com/RiaServices/Release/ProjectReleases.aspx?ReleaseId=2661

This is a great little tid-bit that we had a hard time finding in Google.  I really don't like the built in Membership Roles, and all of the tables that ASP.NET Role Based Provider creates.  The CustomAuth sample inside this ZIP will let you use an Entity Model with an Authentication Domain Service in Silverlight so that you pull directly from your model when authenticating.

Some Gotchas:

If you don't use a standard User Table that matches IUser, you must create a public partial class.  In this case Agent.cs to go with your AgentModel.edmx.  You must extend your class to include a Roles IEnumarable<string> and a Name string.  Name is used by WebContext to identify the user.

This IS .NET Authentication that is connected to RIA Services.  Inside your extension of IUSer, you also need to make sure that Name is a Key and both Name and Roles are DataMembers.

 

We also decided to separate out our projects.  This seems like a common thing to do in .NET (Have a data library, a web site, and a test suite).  But this isn't that easy to do with Entity Framework, and Domain Services.

We found this article:

http://www.devtoolshed.com/tutorial-configuring-silverlight-4-entity-framework-and-wcf-ria-services-separate-component-assembli

 It helped a LOT!  But, one thing we did do is get rid of the Web.Service, because it was just too much trouble working with the generated code.  Leaving your DomainServices (for RIA) in the same project as your EDMX is important, and it's just not worth separating them out (trust me it took up several days).

Back to Authentication, another big gotcha when pulling your Solution into various projects is the WebContext.

It must be added to the ApplicationLifetimeObjects, and it can be done in XAML (but it's a guessing game where AuthenticationContext will be).  So, we decided to add it programmatically:

 

You should especially pay attention to this line:

 

((WebAuthenticationService)WebContext.Current.Authentication).DomainContext = new RealForms.Web.Data.AuthenticationContext();

Trouble with RIA Services DomainContext Type being Null when using AuthenticationContext?
http://blog.falafel.com/blogs/10-09-10/Setting_the_RIA_AuthenticationService_DomainContextType.aspx

Our XAP Got Big so we Optimized it:

http://www.maxpaulousky.com/blog/archive/2010/06/22/xaps-minifier-an-add-on-to-visual-studio-2010-to-optimize-and-minimize-xap-files-again.aspx

We didn't know enough about VS2010 Language Features like Lambdas and Extension Methods:

http://www.developingfor.net/c-30/upgrade-your-c-skills-part-1-extension-methods.html

That helped!

Great LINQ Examples:

http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx

Symmetric Encryption in Silverlight:

http://forums.silverlight.net/forums/p/14449/414950.aspx

Okay, that's about it for today.  That's a lot. haha..

 

Blog Post Seperator
Leave a Comment
Name:
Email Address:
(will not be published)
Comment:
 
Lynergy Web Application Development Blog
We don't just build great web sites. We build tools that make your company more efficient and we train your company to use those tools effectively.
359 E. Robinson Ave.
Springdale, Arkansas  72764
 
Toll Free: (866) 582-0358
Phone: (479) 313-6431
support@lynergy.com
Web Application Development
Training
Content Management Systems
Forms Management Software
iPhone Application Development
Mobile Web Sites
Streaming Audio
Lynergy.com Web Application Development
RealFormsArkansas.com - Realtor® Contract Management Software and Digital Signatures
Rentmind.com - Online Rent Payments for Landlords
NWAMenus.com - Northwest Arkansas Menus and Restaurant Guide