3

I get the following Metadata Exception from Entity Framework when running query:

Schema specified is not valid. Errors:

error 0194: All artifacts loaded into an ItemCollection must have the same version. Multiple versions were encountered.

Oracle.DataAccess.src.EntityFramework.Resources.EFOracleStoreSchemaDefinition.ssdl(2,28) : error 0172: All SSDL artifacts must target the same provider. The Provider 'System.Data.SqlClient' is different from 'System.Data.SqlClient' that was encountered earlier.

Oracle.DataAccess.src.EntityFramework.Resources.EFOracleStoreSchemaDefinition.ssdl(2,64) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '9.2' is different from '2012' that was encountered earlier.

This is my Entity Connection String

"metadata=res://*;provider=System.Data.SqlClient;provider connection string=\"SERVER=SERVER;DATABASE=DB;Trusted_Connection=True;\""

(It is derived from a normal connection string using this method:

private static string GetEntityConnectionString(string connectionString)
        {
            var sbEntity = new EntityConnectionStringBuilder();
            sbEntity.Provider = "System.Data.SqlClient";
            sbEntity.ProviderConnectionString = connectionString;
            sbEntity.Metadata = "res://*";

            return sbEntity.ToString();
        }

I pass it a standard connection string: "SERVER=SERVER;DATABASE=DB;Trusted_Connection=True;"

Very strange that it thinks it's somehow Oracle related. How do I fix this?

PeterX
  • 2,713
  • 3
  • 32
  • 42
  • Seems we're deploying into a platform already using Entity Framework (and must be using Oracle somewhere). I tried different combinations with a [DLL name](http://stackoverflow.com/a/20781365/845584) but I had to give-up on this approach and now also pass the entity string (rather than relying on a `Provider Connection String` conversion). The full string matches the `App.Config` file and breaks down the metadata component into each bit csl/ssdl/msl, e.g. `metadata=res://*/Folder.ModelFileName.csdl|res://*/Folder.ModelFileName.ssdl|`... Strange that conversion code above just didn't work. – PeterX Jan 15 '15 at 01:59

0 Answers0