EF4抛出一个错误"模式指定无效" [英] EF4 is throwing an error "Schema specified is not valid"

查看:293
本文介绍了EF4抛出一个错误"模式指定无效"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一个奇怪的EF4实体框架v4的错误,当我做一个选择的范围内。

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

在那里,我得到的是:

指定的架构是无效的。错误: 的关系AnalyzerConfigurationModel.FK_AnalyzerMetadataParameters_AnalyzerMetadata未加载因为类型AnalyzerConfigurationModel.AnalyzerMetadataParameter不可用。

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

要生成错误的查询是:

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

该模式是显示如下。

The schema is show below.

我检查了连接字符串,多次,它不是。一切都看起来很好。我不知道这会从这个模式生成的XML是关闭与否。但看着有太多而没有看到任何关闭或不同于其他的属性。有没有人遇到这样的人之前?

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?

推荐答案

所以...我只是碰到了这个问题为好。事实上,我发现,如果我展开Solution Explorer中的EDMX文件(VS 2012),右点击每个 .TT 文件,并选择运行自定义工具也解决了该问题。这可能是更容易比德

So... I just ran into this issue as well. I actually found that if I expanded the EDMX file in solution explorer (VS 2012) and right clicked on each .tt file and selected Run Custom Tool also fixed the issue. This might be easier than de

这篇关于EF4抛出一个错误"模式指定无效"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆