Note that there are some explanatory texts on larger screens.

plurals
  1. POEntity Framework 4 + Self-Tracking Entities + ASP.NET Dynamic Data = Error
    text
    copied!<p>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:</p> <p>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, Func<code>1 contextFactory) at System.Web.DynamicData.ModelProviders.SchemaCreator.CreateDataModel(Object contextInstance, Func</code>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</p> <p>RegisterRoutes looks like this:</p> <pre><code>DefaultModel.RegisterContext((() =&gt; new DataContext.Entities()), new ContextConfiguration() { ScaffoldAllTables = true }); </code></pre> <p>The default constructor on the Context has been modified to use my my connection string, which looks like this:</p> <pre><code>&lt;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"/&gt; </code></pre> <p>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?</p> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload