find a location for property in a new city

Thursday 24 June 2010

Entity Framework MetadataException: Unable to load the specified metadata resource

I got a "System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation" error with a description of "System.Data.MetadataException: Unable to load the specified metadata resource. at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResources".

This occurred when I was trying to move my Models out of my main MVC web application assembly. The main web dll is called Web and within that project is a folder called Models that is used to store all my *ahem* Models and entity data models etc. I decided to move everything in the Models folder out into its own Models assembly. I edited all the namespaces and everything built okay.

However, I was getting a runtime MetadataException when trying to view the page. What the hell is going on?!

Solution

The problem is that the connection string was incorrect. It wasn't immediately obviously with that error message but when you think about it, it makes sense.

My connection string was: connectionString="metadata=res://*/Models.Messaging.MessagingObjects.csdl|res://*/Models.Messaging.MessagingObjects.ssdl|res://*/Models.Messaging.MessagingObjects.msl;....etc"

Just so you know the metadata represents this metadata=res://{assembly}/{namespace}.{filename}.csdl|res://{assembly}/{namespace}.{filename}.ssdl|res://{assembly}/{namespace}.{filename}.msl;

Since I have moved the models around and the namespace is now different I needed to make it connectionString="metadata=res://*/Messaging.MessagingObjects.csdl|res://*/Messaging.MessagingObjects.ssdl|res://*/Messaging.MessagingObjects.msl;

Just for further understanding I could have replaced the asterix with Models since that is the name of the dll that contains my Messaging models.

Follow britishdev on Twitter

41 comments:

  1. Thanks for the post, solved my issue I was having!

    ReplyDelete
  2. Great, I had exactly the same problem right now and solved it with your help. thank you so much!

    ReplyDelete
  3. Thank you so much...did not consider it at all...

    ReplyDelete
  4. I am using model first. I generated the domain classes and moved them into a separate project. I also move the context to a separate class. I changed my app config file to add the namespace. I still get the message. I also tried adding the assembly name. That caused a different problem. I have the app config file in my model, domain and context assembly. Same config file in each case. My config file is:






    ReplyDelete
  5. Nice post, helped me figure this app out!! Thanks!!

    ReplyDelete
  6. You have found a good solution for this problem. I will use this today. Thanks for the article, and in case you'll be looking for another dll file, you can use the msvcr120.dll download https://fix4dll.com/msvcr120_dll and easy fix the problem, maybe it's just because that you have the wrong file.

    ReplyDelete
  7. Hi, I am new to EF. I created an edmx file for my project. I get the same metadata error mentioned here. To try the solutions provided here, can someone tell me how/where to find the names for the namespace and assembly?

    ReplyDelete
  8. This seems to be really great. if you are looking for AOl Customer Service then you can contat at AOl tech Support Phone Number for help. they will guide you to resolve your issue as soon as possible.

    ReplyDelete
  9. Bài viết của bạn rất hay!

    Công ty In Ấn Phúc Nguyên cung cấp các dịch vụ giá rẻ nhất tại hà nội:



    Báo giá in thùng carton giá rẻ nhất



    in bao bì tại hà nội



    in hộp cứng

    ReplyDelete
  10. This is a great inspiring article. I am pretty much pleased with your good work. You put really very helpful information.
    AOL Technical Support Number

    ReplyDelete
  11. There are many software which are continuously being introduced in the market due to technological advancements. Many companies try to launch different types of software that prove to be user-friendly and have the goal of achieving its maximum popularity. Telecom company AOL Inc. is quite well known and known for delivering elite quality products and services in the market. You need to download AOL desktop gold in your computer to enjoy seamless services by AOL. You need to visit our website http://webslivesupport.com/aol-desktop-gold/
    Download AOL desktop gold
    AOL desktop gold download
    Download and install AOL desktop gold

    ReplyDelete
  12. It is not uncertain whether users may encounter problems while using email services and during a certain period of time they may encounter an error during a critical period. But, this can be dealt with soon, all you need to do is dial an email support number to get an email help and get rid of the problem.You need to visit our website http://webslivesupport.com/
    email support number
    email customer care numberr
    Download AOL desktop gold
    AOL desktop gold download



    ReplyDelete
  13. hello,Its really nice post.Thanks For sharing a good post.Something else I would like to talk about is that Max Global Support.Do you know how to return a DIRECTV receiver? If you would like to know how you need to return DIRECTV equipment,you need to know which ones AT&T wants back. It’s a simple process where you can return DIRECTV equipment to the company.Just click here to follow the steps… DirecTV return equipmentand also call on toll free technical support phone number +1-888-957-7111, to solve your problem within a minutes.

    ReplyDelete
  14. Air China is also known for its amazing and cooperative customer service. Air China Customer Service helps you to experience the best travel, and you can also make some amazing memories by planning your travel with Air China through Air China Customer Service.

    ReplyDelete
  15. Dial Southwest Phone Number and get best offers for every booking and fly with the cheap rates only with southwest airlines. you can enjoy at your amazing destinations. Our agents are there to help with best solutions over the Southwest Phone Number.

    ReplyDelete
  16. Harmony in the arms of a beautiful woman can change the landscape of a man’s life and he might feel levitated because of her company in a romantic way; Bangalore Escorts Service. Seduction process is a tedious job and efforts it requires before the wasteful body structure is infinite before the eyes of the almighty. Turbulence in the work space is usually because of different personalities trying too hard to show their dominating nature to the other individuals at the same space; Bangalore Escorts. Hey my name is Kiran Bajaj and this is my story and I am sticking to it. The story also allows some benevolent features of a woman to explode in the sanctity of erotic pleasure. I have dedicated my life to the needs of troubled men who were never appreciated in their life to a point that it exploits the desires in a wrong sense and hence the differential aspects emerge without any intentions; Bangalore Call Girls. Overly sophisticated women prefer men of high caliber who understand them for who they are not they want them to be. The society dictates the values of gnarled ethics of human commitment are threatened by the fake feminists of the world. Radical left of the political discussion leans on the destructive ropes of the rings while the sensible tries to dodge their presence with utmost elegance.

    ReplyDelete
  17. we are a trained troubleshooting guide. We work independently as a reliable third party support provider and provide simple troubleshooting instructions to solve all common errors associated to webmail roadrunner. Our trained troubleshooters are very quick to resolve your issues and make a hassle-free path to enjoy emailing experience.

    ReplyDelete
  18. The add-in extensions in the browser also stop Hotmail working normally. To solve the hotmail not working issue, you need to temporarily disable your anti-virus software, after this try to run your Hotmail once again.

    ReplyDelete
  19. I don’t have ideas about the roadrunner webmail login
    problem, hence I seek for expert’s guidance. I am sharing this login issue with all of you, guys.

    ReplyDelete
  20. I have tried many Hewlett Packard laptop troubleshootingsolutions for this error, but no results. Now, I am looking for the solid and permanent resolutions for fixing this technical problem. I want to take the expert’s technical help to rectify this technical problem. Could anyone share the easy troubleshooting ways to resolve Hewlett Packard laptop not responding error?

    ReplyDelete
  21. This comment has been removed by the author.

    ReplyDelete
  22. Top Ph.D Research Topics in Management & Business Students

    A Ph.D is a degree that refers to the Doctor of Philosophy. It is the highest degree that can be earned after years of gruelling research and practice. Every field of education awards Ph.D degree. This blog is concerned with the field of business and management which also provides Doctorate after the successful completion of dissertation period.

    ReplyDelete
  23. One of the most famous questions that strike almost every student’s mind is “How many pages is 1000 words?” Despite what you are using MS Word or Google Docs, sometimes counting the words is essential for academic work. Pages not only rely on the number of words but also the font size, spacing margins, and paragraphs. By proceeding further, the method of counting pages depends on all the mandatory factors.

    For More Relevant Information Visit here- https://www.ivedahelp.com/education/how-many-pages-is-1000-words/

    ReplyDelete
  24. A well written Content provided by you. Your writing skills are perfect spirit airlines phone number. i hope so you will write more content like this but if you are searching for flights then contact us or visit our website.

    ReplyDelete
  25. Great Post !! I admire the valuable information you have mentioned in your blog.
    Visit: Organizational Behavior Assignment Writing Help

    ReplyDelete
  26. British Career Group providing best IELTS coaching and test preparation classes in mohali. We have British Council trained staff members who have got over the years of IELTS teaching experience and our students have scored up to 9 bands in Listening, up to 8.5 bands in Speaking, up to 8.0 bands in writing and up to 8.5 bands in reading modules.
    British Career Group is authorized by the British Council to book the IELTS test dates for our clients and get them the study material for reading and writing sections and CD for the listening section. We have a decent computer lab for our students to prepare the listening module and other sections apart from adequate arrangements to prepare the students for the CB IELTS test. There are many of our Immigration students who have scored more than 7 bands in all the four bands to qualify for Australia immigration and many clients have got the perfect 16 points for immigration to Canada. We would like to welcome you to take Demo class for IELTS to know more about the quality of our coaching provided to our students.
    best ielts institute in mohali
    ielts classes in mohali
    Address – SCF 54, 2nd Floor, Phase 7, Mohali
    Email – info@britishcareergriup.com
    Phone – +91-9988922775

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. Health Script is a healthcare technology startup that is currently based in India, and was founded in 2020.

    ReplyDelete
  29. Honker Mindsis a creative agency that harnesses creativity, technology, and culture to create connected brands and beautiful experiences

    ReplyDelete
  30. ThinkEnglish is the best IELTS training Institute in Mohali. We are specialists in training and helping you to succeed in your IELTS examinations. We help our students in every possible ways to improve their grammar, vocabulary, spoken and written English skill. With best best IELTS Coaching in Mohali, you can get to learn both the Academic Module and the General Training IELTS preparation course. Both courses deal everything you need to know about the IELTS test.
    Mission of ThinkEnglish
    • To provide quality education to you and giving wings to your dreams.
    • To focus on the overall development of our students.
    • To inspire you to realize your aspirations towards a successful career and a good life.
    Contact Us: 95777-05000
    Address: SCO 113, First Floor, Phase 11, Sector 65, Sahibzada Ajit Singh Nagar, Punjab 160047
    Best IELTS Coaching in Chandigarh

    ReplyDelete
  31. 1. ThinkEnglish provide best IELTS Coaching in Chandigarh
    Which imparts high quality IELTS Training to help aspiring candidates take a successful leap in IELTS Exam?
    Throughout the IELTS Training in Chandigarh, students will be imparted theoretical and practical sessions for better learning. When exam is near, mock tests will be conducted at IELTS Coaching Center in Chandigarh for two reasons:
    • To evaluate the training grasped by candidates
    • So that students don’t get anxious on the day of final examination
    The tutors at the best IELTS Coaching institute in Chandigarh at ThinkNEXT will give extremely skilled feedback on the strengths and weaknesses of students which plays a major role in the improvement of their performance.
    It’s very easy to put off studying for another day if you don’t have clear aims and objectives. Taking IELTS classes from our Best IELTS Institute in Chandigarh gives you the motivation to study hard and improve your English.
    Contact Us : 95777-05000
    Address: SCO 113, First Floor, Phase 11, Sector 65, Sahibzada Ajit Singh Nagar, Punjab 160047

    ReplyDelete
  32. Jewel House is the best and renowned gold buyer in Chandigarh which offers best price for your gold instantly under transparent procedure. Jewel House believes in paying the highest price for your second-hand gold instantly on the spot. We accept all kind of Gold. You can get instant cash for your Gold.
    1.Best price for 100% value of your gold
    2.Clean & Transparent procedure
    3.Instant payment:Cash, Cheque, Demand Draft and IMPS/NEFT/RTGS (online) transfer service.
    Contact Us: 98151 50400 | 01724616859
    Visit Us: S.C.O - 7, Sector 19-D, Chandigarh
    Sell Gold in Mohali
    Gold Buyer in Chandigarh

    ReplyDelete
  33. This comment has been removed by the author.

    ReplyDelete
  34. Very Informative Blog, Thanks for Sharing. If you want to make a career in Digital Marketing, Then TIDM is here for you. TIDM is the reputed Best Digital Marketing Training Institute In Chandigarh, which offers the Digital Marketing Course taught by the best of the industry trainers with 100+ Modules, 25+ Certifications, 40+ worthy tools and 100% Placement Assistance.
    Book Free Demo Class Now! Call us on 9577704000

    ReplyDelete
  35. Are you a new Facebook user who is looking to find out Where Is Code Generator On Facebook To do so, you have to first launch Facebook application on your mobile device no matter whether you are using an Android device or an iPhone device.Apart from that, you also need to find out and then go to the Security and Privacy section. Here, you have to tap on the ‘Code Generator’ option and you can get a code to sign in to your Facebook account.

    ReplyDelete
  36. Are you one of those users who are unable to find out your Facebook contacts with the help of your phone number? Do you also want to know how it is possible to Find Your Facebook Contacts By Phone Number The best thing you can to do the same in a trouble-free manner is to go to the official Facebook help center where you will be able to find out all possible solutions along with the required information in no time.

    ReplyDelete
  37. First-rate task . Welcome to the party of my 토토사이트

    ReplyDelete
  38. For exceptionalIELTS Coaching Institute in Chandigarh, Dolphin Head Hunters stands out as a premier choice. IELTS Coaching Institute in Chandigarh sector 34 offers tailored programs to help students achieve their desired band scores. Alongside their IELTS preparation courses, Dolphin Head Hunters also provides spoken English classes in Chandigarh ensuring proper skills growth.

    ReplyDelete