I have VS 2008 SP1 Beta & .NET 3.5 SP1 Beta (latest Entity Framework) with SQL 2008 Feb CTP. One of the solutions I am creating is for SQL 2005, one is for SQL 2000. The model databases for these solutions both have the database compatibility level set correctly in SQL Server on my developer machine.
When deploying the SQL 2005 solution (a C# 3.5 windows service which queries the database with Entity Framework) an exception is thrown during the Entity Framework's internal command execution generator which states that "datetime2" is not supported on the server version.
This is incorrect because the database model was indeed compatible and set correctly to use only SQL 2005 (or 2000 in the second solution) types. Also, even if it were a 2008 database, there was no datetime2 in the commands or views which were being queried so why was it trying to use that type?
I discovered the workaround was to edit the model in the VS XML Editor and manually change the ProviderManifestToken from 2008 to 2005 or 2000 according to the desired SQL compatibility level.
I would suggest this is a bug because of:-
1) The default setting should be taken from the source database compaibility level, not the server version of the connection.
2) This attribute should be exposed somewhere visibly in the designer. It is a core setting which affects the deployability of the solution, and developers need to take care.
3) It should not have tried to use datetime2 in it's internally generated code for a schema which only had datetime.
I feel it is normal for a professional developer to have a newer SQL version installed on his work machine, and to create solutions which must support different older SQL server versions.
The most important fix is #2, and I guess this should be a simple fix to simply expose the setting in the designer? I would guess #1 is also straightforward, just query the database comapibility level instead of the server level. Also, perhaps you should prompt the developer during the wizard, which would help communicate the importance of this setting. I would suggest the setting goes into the root of the edmx when open in the designer (i.e. when you click the background of the diagram).