概念类型的成员数与对象侧类型的成员数不匹配 [英] Number of members in conceptual type does not match with number of members on object side type

查看:487
本文介绍了概念类型的成员数与对象侧类型的成员数不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用.net框架3.5 SP1。

I'm using .net framework 3.5 SP1.

将列添加到Sql Server中的一个表(以及将现有列从允许空值更改为不可空),我无法再运行我的项目而不会收到此错误:

After adding a column to one table in Sql Server (as well as changing an existing column from allowing nulls to not nullable), I can no longer run my project without getting this error:



概念类型中的成员数
'XBRLDimensionalModel.axis_t'不

上的成员数匹配对象侧类型
'EOL.Xbrl.Persistence.Data.axis_t'。
确保成员的数量是
一样。

The number of members in the conceptual type 'XBRLDimensionalModel.axis_t' does not match with the number of members on the object side type 'EOL.Xbrl.Persistence.Data.axis_t'. Make sure the number of members are the same.

我放弃了找到并修复生成代码。我现在已经删除了我所有的本地实体相关文件,并从头开始重新生成并添加了一个新项目(ADO.NET Entity Data Model)。我仍然会收到这个错误。

I gave up trying to find and fix the generated code. I now have deleted all my local entity-related files and re-generated them by starting over from scratch and adding a new item (ADO.NET Entity Data Model). I still get this error.

现在我可以运行该项目的唯一方法是撤消所有我的待处理更改,并使用源代码控制的最后一个版本,当然更改两个修改后的数据库列可以为空。

The only way I can run the project now is to undo all my pending changes and use the last version from source control, and of course change the two modified database columns to nullable.

从目前为止,我已经读过,似乎我应该能够从数据库更新我的模型。这导致了这个例外(上图)。但是现在我完全感到困惑,即使实体模型和支持类的完全重新生成,我仍然收到这个错误。

From all I've read so far it seems like I simply should have been able to "update" my model from the database. That resulted in this exception (above). But now I'm totally confused that even with a complete regeneration of the entity model and supporting classes I'm still getting that error.

我更改了我的edmx的属性模型:元数据人工处理到复制到输出目录。 Designer.cs,csdl,msl,ssdl文件似乎与最新的数据库更改一致。

I changed the property on my edmx model: "Metadata Artifact Processing" to "Copy to Output Directory". The Designer.cs, csdl, msl, ssdl files all seem to be consistent with the latest DB changes.

第一次引用entityModel实例时抛出异常。所以在任何加载或保存数据从更改的表之前。

The exception is being thrown the first time my entityModel instance is referenced. So it is prior to any loading or saving of the data from the changed table.

任何想法我错了什么?
谢谢,
TG

any ideas where I'm going wrong? Thanks, TG

推荐答案

将您的模型打开为XML。从CSDL中删除对该类型的所有引用。保存并关闭,然后重新打开GUI。现在你应该能像往常一样更新模型。如果这不行,请做同样的事情,但也从MSL中删除。

Open your model as XML. Remove all references to that type from the CSDL. Save and close, then reopen in the GUI. Now you should be able to update model as usual. If that doesn't work, do the same thing, but remove from MSL as well.

这篇关于概念类型的成员数与对象侧类型的成员数不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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