Number of members in conceptual type does not match with number of members on object side type



I'm using .net framework 3.5 SP1.

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:

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.

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.

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.

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.

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

1/19/2010 9:31:32 PM

Accepted Answer

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.

1/19/2010 8:13:14 PM

Popular Answer

This error can also happen if the EDMX file was changed outside Visual Studio. Right click on the EDMX file and click "Run Custom Tool"

Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow