I have a SilverLight
application which uses entity framework 4
for data access layer. I need to manually create some entity objects and later save to database.
I have this peculiar problem. When Instantiate the object and then assign some values to its property I got an error "An item with the same key has already been added". This is before the object is even added to the instance of ObjectContext
. Also, before switching to SP1 of Visual Studio
, there is no problem. It only happens after we upgraded the VS2010 to SP1.
In code, it is like this.
class cls = new class();
cls.class_name = "test";
The exception is thrown when class_name is assigned a value at run time. "class" is an entity object manually created and it maps to a table in th SQL database
.
Where I should look to solve this problem?
Any help is greately appreciated.