Error on trying to intance model entities... and boom error

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Posts: 8
Joined: Fri 19 Sep 2008 13:36

Error on trying to intance model entities... and boom error

Post by Wupaz » Tue 24 Nov 2009 15:39

I do that :
var j = new DataSourceModel1Entities();

I got an error there...

public partial class DataSourceModel1Entities : global::System.Data.Objects.ObjectContext
/// Initialize a new DataSourceModel1Entities object.
public DataSourceModel1Entities() :
base(@"name=NetbackmodelConnectionString", "DataSourceModel1Entities")

Error : (EmbedInOutputAssembly)
Unable to load the specified metadata resource.

Error :(CopyToOutputDirectory)

System.Data.MetadataException was unhandled
Message="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."
at System.Data.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.EntityClient.EntityConnection.SplitPaths(String paths)
at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections)
at System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection()
at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor)
at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)
at Netbackmodel.DataSourceModel1Entities..ctor() in C:\Dev\Test\db test\db test\DataSourceModel1.Designer.cs:line 21
at db_test.Program.Main(String[] args) in C:\Dev\Test\db test\db test\Program.cs:line 14
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Any idea?

Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 25 Nov 2009 12:24

Please refer to the latest post in this thread:
This should be the case.

Post Reply