Click here to Skip to main content
15,886,061 members
Articles / .NET
Tip/Trick

Entity Framework: ProviderManifestToken not valid

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
8 Jan 2013CPOL 23K   3  
This tip attempts to solve ProviderManifestToken issue

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: 

XML
<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:

XML
<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! 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions

 
-- There are no messages in this forum --