Note that there are some explanatory texts on larger screens.

plurals
  1. POEF and Multiple SQL Versions in one assembly - is it possible
    text
    copied!<p>This has got me a little annoyed to say the least...</p> <p>I'm upgrading a service layer project to v.next and in the process 'upgrading' all my Linq to Sql models to Entity Framework. So far I've done four databases and am now running tests - my tests fail with the error</p> <blockquote> <p>System.Data.MetadataException: Schema specified is not valid. Errors: DB.WebDB.ssdl(2,84) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '2008' is different from '2005' that was encountered earlier.</p> </blockquote> <p>Doing some googling I find that this is often caused by different dev/live sql server versions.</p> <p>My scenario is different, however - I have multiple live database servers running different versions - 2005, 2008 and 2008 R2 - and I need to be able to talk to all of them, with different EDMXs.</p> <p>On this SO: <a href="https://stackoverflow.com/questions/1061409/multiple-versions-of-sql-server-using-entity-framework-in-a-single-asp-net-appli">Multiple Versions of SQL Server using Entity Framework in a single ASP.NET application</a> it seems that one solution is to split the EDMXs for different versions out to different assemblies (i.e. a 2005 and 2008 version). Presumably another solution will be force my <code>ProviderManifestToken</code> on the 2008-sourced databases to be <code>2005</code>.</p> <p>However, to me, the idea that I have to create different assemblies purely just to satisfy a quirk of behaviour in EF that can make one EDMX break all others is ridiculous - for me, separate assemblies are an architectural decision. Equally, hacking the EDMX file to downgrade the 2008 databases also is not desirable, especially when the next 'Update from database...' command will change it back again.</p> <p>Anybody got an alternative solution?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload