Introduction
Recently I've been working with Oracle database and Entity Framework.
Testing my ASP.NET MVC application was going fine until I had to deploy it to a remote server. When launching the application an unexpected error came out:
System.Data.ProviderIncompatibleException: The provider did not return a ProviderManifest instance.
System.ArgumentException: ProviderManifestToken not valid!
Why did this fail on a different machine? I was sure that Oracle was installed but I didn't thought about the version.
It turns out, in fact, that different versions of Oracle database need different ProviderManifestTokens.
Using the code
When I figured out the problem I had just to switch this line in the .edmx file:
<Schema Namespace="foo" Alias="Self" Provider="Oracle.DataAccess.Client" ProviderManifestToken="11.2" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator">
To this:
<Schema Namespace="foo" Alias="Self" Provider="Oracle.DataAccess.Client" ProviderManifestToken="11g" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator">
Remember always to build after making the change (and to switch back to the previous ProviderManifestToken when developing your application).
Conclusion
Never forget to check whether the server and your machine have equal installations of database, etc.
I hope this trick can help somebody out there. Cheers!