‘Schema specified is not valid’ error on Upgrading to ASP.NET 4

To take advantage of improvements in ASP.NET 4 and Entity Framework 4, I decided to upgrade my ASP.NET 3.5 site to 4.0. Most everything went smoothly except for the following error:

Schema specified is not valid. Errors:
error 0194: All artifacts loaded into an ItemCollection must have the same version. Multiple versions were encountered.

The error hit the moment the application tried to fire up EF. Opening the .edmx file and resaving it didn’t fix the problem.

Here’s the original connection information:

<add name="OBDBEntities1" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=WIN-FR25CRWF5V8\SQLEXPRESS;Initial Catalog=OBDB;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

Unable to track it down, I commented out the existing connection in the web.config and created another one. Here’s what it generated:

<add name="OBDBEntities1" connectionString="metadata=res://*/App_Code.OBModel.csdl|
res://*/App_Code.OBModel.ssdl|
res://*/App_Code.OBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=WIN-FR25CRWF5V8\SQLEXPRESS;Initial Catalog=OBDB;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

As you can see, the upgraded version of EF required much more info about where to get its metadata resource.

A few people have hit this error with various remedies suggested. There you have another possible fix to add to the community’s collection.

Ken

4 Comments

  • Thank You, it solved my problem!

  • Just letting it be known that this issue can be found when upgrading to .NET4.5 and EF5 also. The res://*/; no longer works - it caused my project to try and load other installed data providers (Oracle, Npgsql) and gave a very long winded error message.

    Explicitly listing out the 3 res entries as shown above has solved it after an hour of digging around.

    Thanks for the solution!!

  • After few hours of searching I found this.. you saved my life :-).

  • This saved my life. Explicitly listing out the 3 res entries is the solution. If you don't know where they are you can open your model designer window, look at the properties and see the "metadata" property that the designer is using.

Comments have been disabled for this content.