Wednesday, May 11, 2016

Entity Framework-Unable to load the specified metadata resource

I was working on updating my application with a newer version of Entity Framework when I suddenly encountered the following error message:

Based on a few discussion forum posts, there was a mention that the name of the .csdl, .ssdl and .msl files may have been incorrect/invalid in the Entity Framework connection string.

Well, based on looking at my connection string, I noticed that was indeed the case!

When I re-generated my Entity Framework Designer Model, I ended up changing the name of the underlying EDMX model file which consequently changed all of the names that are also required in the Entity Framework connection string.

Therefore, I had something like the following:

<add name="MyEntities" connectionString="metadata=res://*/OldModel.csdl|res://*/OldModel.ssdl|res://*/OldModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(local);initial catalog=MyCatalog;user id=sa;password=P@ssword!;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Since the EDMX model names were invalid, I had to change it to the following:

<add name="MyEntities" connectionString="metadata=res://*/NewModel.csdl|res://*/NewModel.ssdl|res://*/NewModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(local);initial catalog=MyCatalog;user id=sa;password=P@ssword!;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />

That was all that was needed to resolve my issue!


  1. I was very happy to find this site. I really enjoyed reading this article today and think it might be one of the best articles I have read so far. I wanted to thank you for this excellent reading !! I really enjoy every part and have bookmarked you to see the new things you post. Well done for this excellent article. Please keep this work of the same quality.
    Data Science Course in Bangalore

  2. I need to thank you for this very good read and i have bookmarked to check out new things from your post. Thank you very much for sharing such a useful article and will definitely saved and revisit your site.
    Data Science Course

  3. Thank a lot. You have done excellent job. I enjoyed your blog . Nice efforts
    Data Science Certification in Hyderabad

  4. Marks4sure Questions and Answers provide you to the point, precise and comprehensive knowledge of the entire syllabus in select Q&As. dumps consist of the gist of the topics covered in a certification syllabus outline. marks4sure

  5. Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one.
    Continue posting. A debt of gratitude is in order for sharing.
    data science course in kolhapur

  6. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own Blog Engine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it. business analytics course in kanpur

  7. 360DigiTMG, the top-rated organisation among the most prestigious industries around the world, is an educational destination for those looking to pursue their dreams around the globe. The company is changing careers of many people through constant improvement, 360DigiTMG provides an outstanding learning experience and distinguishes itself from the pack. 360DigiTMG is a prominent global presence by offering world-class training. Its main office is in India and subsidiaries across Malaysia, USA, East Asia, Australia, Uk, Netherlands, and the Middle East.

  8. Thanks for sharing this valuable information, we also provide instagram video download and,
    really appreciate your hard work and good research that help us in for of your good valuable article. Keep updating us with your awesome content.