Open RIA Services User Support Can't find metadata  Viewed 28789 time(s), 6 post(s)., 6/18/2014 7:04:36 PM - by PilotBob

PilotBob
PilotBob 6/18/2014 7:04:36 PM

I am getting the following errors when building. I got these when I first moved to the RIAServices.EntityFramework package due to missing connection strings. However, I would expect this build expects the find them in the same place? Any other idea why I would get these errors?


packages\OpenRiaServices.Silverlight.CodeGen.4.3.0.1\build\OpenRiaServices.Silverlight.CodeGen.targets(302,5): error : Failed to get the MetadataWorkspace for the DbContext type 'Amsi.Model.eSite.eSiteEntities'.


This content has not been rated yet. 
70 Reputation 10 Total posts
1
ColinBlair
ColinBlair 6/19/2014 2:43:47 PM

if you switch to the pre-release package (I will be moving them to release very soon) you should get the actual exception in the log after the MetadataWorkspace error.

This content has not been rated yet. 
1539 Reputation 130 Total posts
2
PilotBob
PilotBob 6/19/2014 7:29:01 PM

Ok getting a better message now with the pre-release:

\Product\packages\OpenRiaServices.Silverlight.CodeGen.4.4.0.0-Beta2\build\OpenRiaServices.Silverlight.CodeGen.targets(302,5): error : Failed to get the MetadataWorkspace for the DbContext type 'Amsi.Model.eSite.eSiteEntities'. Exception: The item with identity 'InvoiceStamp' already exists in the metadata collection.
\packages\OpenRiaServices.Silverlight.CodeGen.4.4.0.0-Beta2\build\OpenRiaServices.Silverlight.CodeGen.targets(302,5): error : Parameter name: item

Is this a code gen error? We do have the same field name is several entities. Is that what would cause this? The model generated fine when I was running the RIAServices.EntityFramework NuGet package with EF5.

This content has not been rated yet. 
70 Reputation 10 Total posts
3
ColinBlair
ColinBlair 6/19/2014 7:58:50 PM

Anything under the "Failed to get MetadataWorkspace" umbrella is an Entity Framework error, the problem before was that the EF exception was hidden by the MetadataWorkspace error. I have looked a bit for the cause of that error but haven't seen anything that jumps out at me. I have found comments that it is caused by having an underscore in the entity name, you may want to ask around Stackoverflow or an EF forum to see if someone else has seen this recently.

This content has not been rated yet. 
1539 Reputation 130 Total posts
4
PilotBob
PilotBob 6/19/2014 9:19:09 PM

Yes, that's what I worried about. Part of this upgrade is moving from EF 5 to 6.1. So, there is that. I'll have to run the unit tests and see if I get the same error there. Perhaps the db I am pointing to isn't up to date with the model and those fields are missing. Although, the error implies something else. 

This content has not been rated yet. 
70 Reputation 10 Total posts
5
PilotBob
PilotBob 6/25/2014 6:33:34 PM

This issue was 100% due to EF. Upgrading to EF 6.1.1 fixed the issues. So, Yea!

This content has not been rated yet. 
70 Reputation 10 Total posts
6