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:
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.
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:
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?
Our XAP Got Big so we Optimized it:
We didn't know enough about VS2010 Language Features like Lambdas and Extension Methods:
Great LINQ Examples:
Symmetric Encryption in Silverlight:
Okay, that's about it for today. That's a lot. haha..