Print Page | Close Window

Error during Object Mapper code gen when moving entity from one model to another

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=1526
Printed Date: 25-Mar-2025 at 2:56pm


Topic: Error during Object Mapper code gen when moving entity from one model to another
Posted By: pk55
Subject: Error during Object Mapper code gen when moving entity from one model to another
Date Posted: 20-Oct-2009 at 2:28pm
I had multiple data models for a domain model.  I had an entity defined in one model and needed to move it to another model for a different database.  I removed the entity definitions from the EDMX and then added them to the other EDMX.  When the object mapper runs it throws an error and stops generation:
 
Error during code generation: Index was outside the bounds of the array.
 
Now when I open the object mapper and click on the model that had the entity added to it, it crashes visual studio.
 
Any thoughts on how to recover from this?



Replies:
Posted By: pk55
Date Posted: 20-Oct-2009 at 2:50pm
It turns out the error wasn't related to moving the entity.  It was from the IdeaBlade Injected Base types that is stored on the EDMX in the CSDL.  It had an extra semi-colon between types.  I was editing it by hand and removed a type from this model but missed the separator semi-colon.
 
In the future, it would be nice if the error message had at least said something less generic and more info relating to the actual problem.
 
 
 


Posted By: kimj
Date Posted: 20-Oct-2009 at 5:07pm
We'll see what we can do with better detection when an EDMX contains errors and fails to load, and try to provide better diagnostics.  Thanks for bringing this to our attention!



Print Page | Close Window