System.Data.Entity.Core.MetadataException: Unable to load the specified metadata resource
Posted: Thu 21 Apr 2022 14:30
Hi. I have a web application on .NET Framework 4.8 that uses dotConnect for Oracle version 9.11.951. This application has an EDML object to map the Oracle objects that we are going to use.
When I compile and execute the app locally, with Visual Studio 2019, everything works fine. But, if I compile with an Azure DevOps pipeline, when I execute the app it generates a runtime error of type "System.Data.Entity.Core.MetadataException: Unable to load the specified metadata resource".
Can you tell me why this problem occurs? How do I solve it? Thanks in advance.
The pileline have this tasks:
- NuGet tool installer.
- NuGet (for restore packages).
- Visual Studio Build.
- Publish Build Artifacts.
The exception stacktrace is:
System.Data.Entity.Core.MetadataException: Unable to load the specified metadata resource.
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResources(String assemblyName, String resourceName, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.SplitPaths(String paths)
at System.Data.Entity.Core.Common.Utils.Memoizer`2.<>c__DisplayClass4_0.<Evaluate>b__0()
at System.Data.Entity.Core.Common.Utils.Memoizer`2.Result.GetValue()
at System.Data.Entity.Core.Common.Utils.Memoizer`2.Evaluate(TArg arg)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetArtifactLoader(DbConnectionOptions effectiveConnectionOptions)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetMetadataWorkspace(DbConnectionOptions effectiveConnectionOptions)
at System.Data.Entity.Core.EntityClient.EntityConnection.GetMetadataWorkspace()
at System.Data.Entity.Core.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection()
at System.Data.Entity.Core.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor, ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory, Translator translator, ColumnMapFactory columnMapFactory)
at REGLAMENTARIAModel.REGLAMENTARIAEntities..ctor() in D:\a\1\s\src\InterfazHermes\Models\InterfazHermesModel.Designer.cs:line 55
at InterfazHermes.Models.Repositories.GenericRepositoryFactory..ctor() in D:\a\1\s\src\InterfazHermes\Models\Repositories\GenericRepositoryFactory.cs:line 10
at InterfazHermes.Models.Business.ReglamentariaServicios..ctor() in D:\a\1\s\src\InterfazHermes\Models\Business\ReglamentariaServicios.cs:line 31
at InterfazHermes.ReglamentariaService.Reglamentaria(String codInspeccion, String datosXML) in D:\a\1\s\src\InterfazHermes\ReglamentariaService.asmx.cs:line 329
When I compile and execute the app locally, with Visual Studio 2019, everything works fine. But, if I compile with an Azure DevOps pipeline, when I execute the app it generates a runtime error of type "System.Data.Entity.Core.MetadataException: Unable to load the specified metadata resource".
Can you tell me why this problem occurs? How do I solve it? Thanks in advance.
The pileline have this tasks:
- NuGet tool installer.
- NuGet (for restore packages).
- Visual Studio Build.
- Publish Build Artifacts.
The exception stacktrace is:
System.Data.Entity.Core.MetadataException: Unable to load the specified metadata resource.
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResources(String assemblyName, String resourceName, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.SplitPaths(String paths)
at System.Data.Entity.Core.Common.Utils.Memoizer`2.<>c__DisplayClass4_0.<Evaluate>b__0()
at System.Data.Entity.Core.Common.Utils.Memoizer`2.Result.GetValue()
at System.Data.Entity.Core.Common.Utils.Memoizer`2.Evaluate(TArg arg)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetArtifactLoader(DbConnectionOptions effectiveConnectionOptions)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetMetadataWorkspace(DbConnectionOptions effectiveConnectionOptions)
at System.Data.Entity.Core.EntityClient.EntityConnection.GetMetadataWorkspace()
at System.Data.Entity.Core.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection()
at System.Data.Entity.Core.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor, ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory, Translator translator, ColumnMapFactory columnMapFactory)
at REGLAMENTARIAModel.REGLAMENTARIAEntities..ctor() in D:\a\1\s\src\InterfazHermes\Models\InterfazHermesModel.Designer.cs:line 55
at InterfazHermes.Models.Repositories.GenericRepositoryFactory..ctor() in D:\a\1\s\src\InterfazHermes\Models\Repositories\GenericRepositoryFactory.cs:line 10
at InterfazHermes.Models.Business.ReglamentariaServicios..ctor() in D:\a\1\s\src\InterfazHermes\Models\Business\ReglamentariaServicios.cs:line 31
at InterfazHermes.ReglamentariaService.Reglamentaria(String codInspeccion, String datosXML) in D:\a\1\s\src\InterfazHermes\ReglamentariaService.asmx.cs:line 329