?
Solved

The specified default EntityContainer name 'Automation_CSRSEntities' could not be found in the mapping and metadata information.

Posted on 2013-12-30
7
Medium Priority
?
1,855 Views
Last Modified: 2014-05-11
Since updating my edmx file with a few small table changes I've been receiving this error:

The specified default EntityContainer name 'Automation_CSRSEntities' could not be found in the mapping and metadata information.
Parameter name: defaultContainerName

I've tried deleting all the edmx files and recreating them from scratch but unfortunately this has not solved the issue.  So far I've not had any luck finding any relevant information in my searches.  We're using SQL2012.  Any help would be appreciated.

Thanks,
Greg


It breaks at line 52

Source Error:

Line 50:         /// Initialize a new Automation_CSRSEntities object.
Line 51:         /// </summary>
Line 52:         public Automation_CSRSEntities(EntityConnection connection) : base(connection, "Automation_CSRSEntities")
Line 53:         {
Line 54:             this.ContextOptions.LazyLoadingEnabled = true;

Open in new window



Stack Trace:

[ArgumentException: The specified default EntityContainer name 'Automation_CSRSEntities' could not be found in the mapping and metadata information.
Parameter name: defaultContainerName]
   System.Data.Metadata.Edm.ClrPerspective.SetDefaultContainer(String defaultContainerName) +7893705
   System.Data.Objects.ObjectContext.set_DefaultContainerName(String value) +69
   System.Data.Objects.ObjectContext..ctor(EntityConnection connection, String defaultContainerName) +75
   Automation_CSRSModel.Automation_CSRSEntities..ctor(EntityConnection connection) in d:\eS\App_Code\Automation_CSRS.Designer.cs:52
   OrderProcessHistoryRepo..ctor(EntityConnection con) in d:\eS\App_Code\Repo\OrderProcessHistoryRepo.cs:25
   _sharedControls__Automation_autoRightFaxUploader.btnRightFaxCompleted_Click(Object sender, EventArgs e) in d:\eS\_sharedControls\_Automation\autoRightFaxUploader.ascx.cs:144
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9552874
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
0
Comment
Question by:Greg_L_WER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39748319
Does the connection string in the config file look correct?
0
 

Author Comment

by:Greg_L_WER
ID: 39748586
Connection string should be fine... I've removed it and let the edmx creation recreate it in the web.config.  I didn't make any changes to it...

<add name="Automation_CSRSEntities" connectionString="metadata=res://*/App_Code.Automation_CSRS.csdl|res://*/App_Code.Automation_CSRS.ssdl|res://*/App_Code.Automation_CSRS.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=******;initial catalog=******;persist security info=True;user id=******;password=******;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39750227
EntityContainer name could not be found in the mapping and metadata information
http://netsideout.blogspot.com/2009/08/entitycontainer-name-could-not-be-found.html

This error can mean a mismatch between the metadata referenced in the connection string (i.e., in config) and the embedded resource in your assembly.
0
How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

 

Author Comment

by:Greg_L_WER
ID: 39760532
Thanks... I'd come across that blog earlier and installed .NET Reflector 8.  Doesn't appear to be any decent help documentation on it.  Any idea where do I even begin to look?  

Thanks,
Greg
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39760706
Greg,

If you add a new ADO Entity Data Model to a project, you get this:

1) A generator data context file (.edmx extension)

2) A connection string in the application configuration file (app.config or web.config depending on application type).

Here is an example:

I added a new ADO Entity Data Model pointing to an SQL Server Database File (Music.mdf).

Connection string in app.config:

<connectionStrings>
  <add name="MusicEntities"
     connectionString="metadata=res://*/Music.csdl|res://*/Music.ssdl|res://*/Music.msl;
        provider=System.Data.SqlClient;
        provider connection string='data source=(LocalDB)\v11.0;
                attachdbfilename=Music.mdf';
        integrated security=True;
        connect timeout=30;
        MultipleActiveResultSets=True;
        App=EntityFramework'"  
     providerName="System.Data.EntityClient" />
  </connectionStrings>


The connection string starts with 3 different metadata properties:

Conceptual schema definition language (CSDL)
Store schema definition language (SSDL)
Mapping specification language (MSL)

If you open the .edmx file (an XML file), you will see different portions.

1. SSDL Content



    <!-- SSDL content -->
    <edmx:StorageModels>
      <Schema Namespace="MusicModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2008" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">
        <EntityType Name="Album">
          <Key>
            <PropertyRef Name="AlbumId" />
          </Key>
...


2. CSDL Content


  <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema Namespace="MusicModel" Alias="Self" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
...


3. MSL Mapping (C - S Mapping)


  <!-- C-S mapping content -->
    <edmx:Mappings>
      <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2008/09/mapping/cs">
...

 
The resource names should match those in the connection string:

Music.csdl
Music.ssdl
Music.msl

I can use this C# code to get the manifest resource names from the assembly:

  var assembly = System.Reflection.Assembly.GetExecutingAssembly();
            var resourceNames = assembly.GetManifestResourceNames();

            Console.WriteLine(resourceNames);

Open in new window


Here is the result of the Console.WriteLine:

Debugging Output for Assembly.GetManifestResourceNames
0
 

Accepted Solution

by:
Greg_L_WER earned 0 total points
ID: 40045824
Unfortunately this didn't solve my issue... I ended up reverting back to an earlier version of my edmx file and restarted my changes at that point.
0
 

Author Closing Comment

by:Greg_L_WER
ID: 40057029
Other suggestions didn't solve the issue... need to close out this question
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question