Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6196489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:39:06+00:00 2026-05-24T03:39:06+00:00

Using EF 4.0. I have two entity models, both named CoreEntities, but in different

  • 0

Using EF 4.0. I have two entity models, both named CoreEntities, but in different assemblies and in difference namespaces.

If I have a single project that references both assmeblies, EF seems to get confused as to what the proper metadata artifacts to load are.

Specifically, I get errors like:

The EntitySet name 'CoreEntities.MyEntities' could not be found.

As soon as a remove a reference to one of the assemblies, the errors stop happening.

I’m unsure as to whether this makes a difference, but I am using the following code to genereate my entitiy connection string:

public static string BuildEntityConnectiongString(string entityContextName)
{
    //Format: metadata=res://*/{EntityContext}.csdl|res://*/{EntityContext}.ssdl|res://*/{EntityContext}.msl;provider=...
    string rawString = System.Configuration.ConfigurationManager.ConnectionStrings["GenericEntityConnectionString"].ConnectionString;
    return rawString.Replace("{EntityContext}", entityContextName);
}

How does EF determine which assembly to look for the embedded meta data in? One would think it would always look in the assembly which contains the model first, but apparently that’s not the way it works.

Ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:39:07+00:00Added an answer on May 24, 2026 at 3:39 am

    As usual, a quick look at documentation provides the answer:

    http://msdn.microsoft.com/en-us/library/cc716756.aspx

    Basically, the wildcard in res://*/ tells the EF to search all loaded assemblies for the meta data. The first one that it finds that matches, it uses.

    In my case, it finds the wrong one first.

    The resolution to this is to modify my BuildEntityConnectiongString function (and the generic connection string I’m using) to allow me to specify the assembly name explicitly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different applications and I am using GroupLab Networking to communicate between
I'm pretty new to MVC 2 using the Entity Framework. I have two tables
I have a Database Entity Model within my ASP.Net Project There are two foreignkeyconstructs,
I have a has_many and belongs_to association set up between two models: Project and
When Using UIPickerController I have two choices on my App: take a picture take
i have two select using as a dropdownlist for country/state everything works as i
I have two dates (parsed using str2time ). How can I tell if one
I have two IIS servers running using NLB. Unfortunatelly I cannot use shared session
I have two byte arrays in C# using .NET 3.0. What is the most
I have two textures generated using a fragment shader. I want to be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.