views:

38

answers:

1

I'm getting a weird EF4 "Entity Framework v4" error when I do a select on the context.

There I get is:

Schema specified is not valid. Errors: The relationship 'AnalyzerConfigurationModel.FK_AnalyzerMetadataParameters_AnalyzerMetadata' was not loaded because the type 'AnalyzerConfigurationModel.AnalyzerMetadataParameter' is not available.

The query to generate the error is:

Using context As New AnalyzerConfigurationEntities
      Dim EFAnalyzerConfiguration = (From P In context.AnalyzerConfigurations
                                     Where P.Name = analyzerConfigurationName).FirstOrDefault
End Using

The schema is show below. alt text

I've checked the connection strings, multiple times, its not that. Everything looks fine. I'm not sure if the XML that gets generated from this schema is off or not. But looked there too and don't see anything off or different from other properties. Has anyone run into this one before?

A: 

Are you using the SelfTracking Entity T4 template? I had this issue and found out the T4 template was not re-generating my entities after I had changed the Entity model in the Entity Designer. Try to right click the T4 Template and click "Run custom tool", and see if that helps.

JohnEgbert