I have two folders in a project Connections & Entities, I wan't to build an EntityConnection object in a class in the Connections folder that sets up connections for Entity Models in the Entities folder but I am having a problem with the MetaData property:
When I run the code with the above setup and entityBuilder.Metadata = @"res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl"; I get an "Unable to load the specified metadata resource.", If I move the Entity Models out of the Entities folder into the
root of the project it works correctly. If I move the Entity Models back to the Entities folder and change the MetaData string to @"res://*/Entities/Model1.csdl|res://*/Entities/Model1.ssdl|res://*/Entities/Model1.msl"; I get the following error : "The specified
metadata path is not valid. A valid path must be either an existing directory, an existing file with extension '.csdl', '.ssdl', or '.msl', or a URI that identifies an embedded resource." Any ideas on how I can set this up correctly? Thanks in advance Rob
entity data frameworkASP.NET 3.5 Extensions.NET 3.5 SP1C#Entity Frameworksp1Net 3.5 SP1
I found this on the MSDN site as I was having the same problem
"I deleted the Model file and the app.config file. Once deleted, I created them again, and it is now working.
I do not know why this hapenned, but somehow it is working."
Basically if you make any changes to the model this may happen.
Marked as answer by mbanavige on Mar 16, 2010 12:59 AM
rcfearn
Member
54 Points
41 Posts
Metadata Path issue for Entity Connection "Unable to load the specified metadata resource."
Dec 23, 2008 01:31 AM|LINK
entity data framework ASP.NET 3.5 Extensions .NET 3.5 SP1 C# Entity Framework sp1 Net 3.5 SP1
dm19898
Member
118 Points
24 Posts
Re: Metadata Path issue for Entity Connection "Unable to load the specified metadata resource."
Aug 20, 2009 12:40 AM|LINK
I found this on the MSDN site as I was having the same problem
"I deleted the Model file and the app.config file. Once deleted, I created them again, and it is now working.
I do not know why this hapenned, but somehow it is working."
Basically if you make any changes to the model this may happen.