MVC 3 with SQLCE4.0 Roles and Membershipby satman
Ive been experimenting with MVC 3 in VS2010 but wanted to be able to deploy the sites with ASP Roles and Membership capability without having to sign up for MSSQL hosting.

Sqlce4.0 is a nice compact database with enough oompf to be usable as a membership database, but some hosters dont provide the necessary libraries to run it, even with a Server 2008 / .Net 4.0 environment.

The main issue was to find a provider package which would enable MVC or Webforms to be able to use an sqlce4.0 (sdf) database easily, in the past I ran this blog using MS Access as a way to host free databases and used that.

I first implemented a blank MVC 3 site with ErikEJ.SqlCeMembership 2.1 NuGet package which worked well, but Microsoft have just released their Microsoft Universal Web Provider which makes it even easier. 

After creating a new MVC 3 web application (C#) I needed to Add Deployable Dependancies (right click on project in VS2010 Solution Explorer) to make sure the MVC and SQL4.0 files were added to the project to allow hosting properly. Both versions are downloadable as VS2010 templates (download the zip files and place in your documents/VS2010/Templates/ProjectTemplates folder )

MVC site with ErikEJ.SqlCeMembership 2.1 NuGet package
MVC site with Microsoft Universal Web Provider

They both include a prepared SqlCeAspnetdb.sdf database with a user Administrator (pwd mvc4dmin) and a couple of Roles, these can be altered using the ASP.Net Configuration tool in Solution Explorer.

0 Comments #129 Thursday, November 24, 2011 05:12 PM Filed in Technology
Name (Required)
Email (Required)
URI(will display as a linkback)
Comment (Required)
129 (no script tags allowed)

Custom Blog Engine Developed by Satman