Print Page | Close Window

Unable to evaluate XPath: '' or Attribute: 'MaxLength'

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=848
Printed Date: 27-Jan-2026 at 7:17pm


Topic: Unable to evaluate XPath: '' or Attribute: 'MaxLength'
Posted By: smiller
Subject: Unable to evaluate XPath: '' or Attribute: 'MaxLength'
Date Posted: 19-Jun-2008 at 2:33pm

Getting an error with DEF RC1 when trying to Save the Domain Model from inside the DevForce EF Object Mapper that says:

Failed to save model file:
'C:\myfile.ibedmx'.

Eval error: Unable to evaluate either XPath: '' or Attribute: 'MaxLength'

Thinking maybe my ADO.NET Entity Data Model was corrupted I blew that project away completely and slowly started from scratch, this time adding only a single table to the model.  Saved my Model.edmx file, opened DevForce EF Object Mapper, clicked the Save button with success.

Went back to the Model.edmx file in the designer, added another table, saved the Model.edmx file, opened DevForce EF Object Mapper, clicked the Save button and saw the same error message outlined above.



Replies:
Posted By: kimj
Date Posted: 20-Jun-2008 at 9:55am
Can you post your edmx file? -- or if too large, send it to mailto:support@ideablade.com - support@ideablade.com .
 
Thanks.


Posted By: smiller
Date Posted: 22-Jun-2008 at 8:14pm
Sent in email on Friday.


Posted By: davidklitzke
Date Posted: 27-Jun-2008 at 11:47am

The root cause of the problem is that the Object Mapper expects a “MaxLength” attribute on each property of Type=”String” in the CSDL section of the edmx file.  We have worked around the problem by adding “MaxLength=”Max” to all “String” properties in the CSDL section of the file that did not adhere to this rule.  This workaroround will be replaced by a real fix in the next maintenance release of the product. If the  “MaxLength” attribute does not exist. We will create an attribute for it.

 



Posted By: sebma
Date Posted: 19-Aug-2008 at 10:08pm
Either you use the workaround from davidkitzke above, or you have to specify the max length for string columns in database then re-generate your edmx. Either way, it is now a hassle if you are updating data definition.



Print Page | Close Window