Our C# projects are developed in Windows XP with visual studio 2008 SP1 with .Net 3.5. We use Entity Framework with Sybase database. One of the sub-projects sharing edmx
file with the main project. It works fine for long time.
Now we are migrating our applications to Windows 7. we found that sub-project stopped to work for us, couldn't connect to database anymore. Same executable put back on XP machine, it works!
This exception was in this line:
AndeDBEntities db = new AndeDBEntities(cs);
Tried with default constructor (no parameter), same exception.
The exception is this:
Unable to load the specified metadata resource. at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResources(String assemblyName, String resourceName, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
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 MyCompany.SystemSoftware.SystemInfo.AndeDBEntities..ctor() in C:\workspace\SystemSoftware\SystemSoftware\src\systeminfo\AndeDB.Designer.cs:line 38
at MyCompany.CommMgr.DBA.getDb() in C:\workspace\SystemSoftware\NBCommMgr\NBCommMgr\DBAccess\DBAccess.cs:line 557
I have to recreate the edmx
in the sub-project and that edmx
file is the same as the file in main project. Then it works. toggled several time, same results.
App.config file was changed accoordingly with the connection string entry.
Any idea, why it is like that?