Friday, March 6, 2009

Enabling Entity Framework (ADO.NET Entity Data Model) in a SharePoint 2007 web.config file

The Entity Framework is considered to be the modern day successor to "LINQ to SQL". If you wish to use this technology in a SharePoint 2007 web part you will need to tweak your web.config file to accomodate the new assemblies that are associated with the Entity Framework. Here are the changes that you need to apply to your web.config file:


1) Add the following tags to the <compilation><assemblies> section:

<add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

<add assembly="System.Data.Entity.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

<add assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

2) Add the following tags to the <compilation> section just under the closing </assemblies> tag:

<buildProviders>

<add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" />

</buildProviders>

No comments:

Post a Comment