Different SQL Server versions and Entity Framework (ProviderManifestToken)

  • Thread starter Thread starter Ralf Kaiser
  • Start date Start date
R

Ralf Kaiser

Hi,

i have a configuration where i use MS SQL Server 2008 Express on the
development machine and MS SQL Server 2005 Express on the real server with
the entity framework.

Whem working with different datatypes (datetimes for example) that can cause
problems because the EF uses the SQL datatype "DateTime2" which is not
supported by the MS SQL Server 2005 Express. I get errors on runtime when
accessing the tables that contain those types.

After a little while of googling i found out that the "*.edmx" files contain
a parameter "ProviderManifestToken" that can be set to "2005" to keep the
data model compatible with MS SQL Server 2005 Express. That works very good,
after a recompile of the application the errors are gone. Fine.

However, every time i refresh the data model form the database (tables
added/changed) VS changes "ProviderManifestToken" back to its original value
"2008". So if i forget to edit this value before publishing the application
i will have the runtime error back. Sigh.

Is there any way to set "ProviderManifestToken" to a FIXED value that VS
will not touch when refreshing the data model?

Thanks in advance,
Ralf
 
None that I know of. This is an attribute that gets set in the SSDL. You can
create a VS addin that turns all SSDL files to the 2005 setting.

Unfortunately, I do not know a way to set this at runtime, as the classes
generated are done automagically behind the scenes.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
Back
Top