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 614187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:05:07+00:00 2026-05-13T18:05:07+00:00

I’m using the Self-Tracking Entities codegen option in EF4 (VS2010 RC), and I’m trying

  • 0

I’m using the Self-Tracking Entities codegen option in EF4 (VS2010 RC), and I’m trying to use Dynamic Data to build a quick-and-dirty website for editing. The Entities, Data Context, and EDMX files are all in separate assemblies, and this model works well when I call everything in code. But when I try to use it with Dynamic Data, right off the bat I get a whole lotta FAIL:

Could not find the CLR type for ‘Core.Recording’.
at System.Data.Metadata.Edm.MetadataWorkspace.GetObjectSpaceType(StructuralType edmSpaceType)
at System.Web.DynamicData.ModelProviders.EFDataModelProvider.GetClrType(EntityType entityType)
at System.Web.DynamicData.ModelProviders.EFDataModelProvider.CreateTableProvider(EntitySet entitySet, EntityType entityType)
at System.Web.DynamicData.ModelProviders.EFDataModelProvider..ctor(Object contextInstance, Func1 contextFactory)
at System.Web.DynamicData.ModelProviders.SchemaCreator.CreateDataModel(Object contextInstance, Func
1 contextFactory)
at System.Web.DynamicData.MetaModel.RegisterContext(Func`1 contextFactory, ContextConfiguration configuration)
at SimpleAdmin.Global.RegisterRoutes(RouteCollection routes) in D:\SimpleAdmin\Global.asax.cs:line 32
at SimpleAdmin.Global.Application_Start(Object sender, EventArgs e) in D:\SimpleAdmin\Global.asax.cs:line 61

RegisterRoutes looks like this:

DefaultModel.RegisterContext((() =>  new DataContext.Entities()), new ContextConfiguration() { ScaffoldAllTables = true });

The default constructor on the Context has been modified to use my my connection string, which looks like this:

<add name="Entities" connectionString="metadata=res://*/Entities.csdl|res://*/Entities.ssdl|res://*/Entities.msl;provider=System.Data.SqlClient;provider connection string="Data Source=xxxxxxxxxx;Initial Catalog=MyDB;Persist Security Info=True;User ID=xxxx;Password=xxxxxxx;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient"/> 

I imagine I’m not referencing the O, C, or CS spaces correctly in the connection string… yet it works just fine if I call the context up in code and use it. So what am I doing wrong?

Thanks!

  • 1 1 Answer
  • 1 View
  • 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-13T18:05:08+00:00Added an answer on May 13, 2026 at 6:05 pm

    Actually, I found a workable solution. It stems from this post: http://thedatafarm.com/blog/data-access/wcf-data-services-and-ef-pocos-that-are-in-their-own-assembly/

    Since I’m only using the Dynamic Data site for quick-and-dirty admin, and not as a customer-facing production site, I’m not concerned about the perf issues introduced in the scenario. So I added a constructor that only DynamicData would use:

    public Entities(bool dynamicData)
        : base(ConfigurationManager.ConnectionStrings["Entities"].ConnectionString, ContainerName)
    {
        Initialize();
        var tracestring = this.CreateQuery<Address>("Entities.Addresses").ToTraceString(); 
    }
    

    then, in Global.asax.cs’ RegisterRoutes function, I now have this:

    DefaultModel.RegisterContext((() =>  new DataContext.Entities(true)), new ContextConfiguration() { ScaffoldAllTables = true });
    

    Works as directed. Kinda irritating,. but every platform has to have mods that don’t play nice together, right?

    HTH.

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

Sidebar

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.