Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Support SQL Server 2005 and 2008

i want to know how it is possible to use the Entity Framework against the SQL Server 2008 and 2005?

I develop a application against the SQL Server 2008 and want that it can run under 2005 and 2008. I know that it is possible to change the ProviderManifestToken from 2008 to 2005 in the edmx Schema File in a Texteditor. But after i update my Model from the Database it changes the ProviderManifestToken back to 2008.

How can i told Visiual Studio to use the the 2005 Schema when i update my model from Database?

Thanks for any Help!

Nico

like image 627
Nico Avatar asked Mar 06 '26 05:03

Nico


1 Answers

Read my blog post on EF and ProviderManifestToken.

Using the MSBuild.Community Tasks, I added a BeforeBuild Target that uses the XmlUpdate task to always change the ProviderManifestToken to 2005, in case someone changed it by updating the data model.

Here is the BeforeBuild Target:

<Target Name="BeforeBuild"> <XmlUpdate Prefix="ssdl"
            Namespace="http://schemas.microsoft.com/ado/2009/02/edm/ssdl"
            XPath="//ssdl:Schema/@ProviderManifestToken"
            XmlFileName="Model.edmx"
            Value="2005"/>
like image 62
jnosek Avatar answered Mar 08 '26 19:03

jnosek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!