Re: "Unable to load the specified metadata resource" error when deploying

1,765 views
Skip to first unread message

Travis Illig

unread,
May 28, 2013, 2:49:43 PM5/28/13
to aut...@googlegroups.com, strat...@gmail.com
I'm guessing it's not a .NET version issue, but I'm not a WebAPI guru so it may be some sort of edge case I've not seen.

Looking at the exception, it's a System.Data.MetadataException, which isn't something Autofac throws. Given the stack trace being in an Autofac resolution, that means it's most likely happening in:
  • A constructor of something that's being resolved.
  • A lambda that got registered as a component.
Some of the stack trace shows that it's in the process of connecting to the database to get some metadata, so could it be a difference in the data between your development environment and your deployed environment?

Unfortunately, as mentioned, I'm not really a WebAPI guy and this looks like it could be an application-specific problem rather than an Autofac problem - not something we can really help with here. I'll let other folks chime in if they're able, but... I, personally, can't really offer much more than that. Sorry.

On Monday, May 27, 2013 8:54:27 PM UTC-7, strat...@gmail.com wrote:
My WebAPI project runs fine locally but when deployed to a remote server I get this ...

{"Message":"An error has occurred.","ExceptionMessage":"Unable to load the specified metadata resource.","ExceptionType":"System.Data.MetadataException","StackTrace":"   at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResources(String assemblyName, String resourceName, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)\r\n   at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)\r\n   at System.Data.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)\r\n   at System.Data.Metadata.Edm.MetadataCache.SplitPaths(String paths)\r\n   at System.Data.Common.Utils.Memoizer`2.<>c__DisplayClass2.<Evaluate>b__0()\r\n   at System.Data.Common.Utils.Memoizer`2.Result.GetValue()\r\n   at System.Data.Common.Utils.Memoizer`2.Evaluate(TArg arg)\r\n   at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections)\r\n   at System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection()\r\n   at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor)\r\n   at OracleModel.OracleEntities..ctor()\r\n   at NectoWebApi.WebApiApplication.<Application_Start>b__0(IComponentContext c)\r\n   at Autofac.RegistrationExtensions.<>c__DisplayClass10`1.<Register>b__f(IComponentContext c, IEnumerable`1 p)\r\n   at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p)\r\n   at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)\r\n   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)\r\n   at Autofac.Core.Resolving.InstanceLookup.<Execute>b__0()\r\n   at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)\r\n   at Autofac.Core.Resolving.InstanceLookup.Execute()\r\n   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)\r\n   at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)\r\n   at Autofac.Core.Activators.Reflection.AutowiringParameter.<>c__DisplayClass2.<CanSupplyValue>b__0()\r\n   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()\r\n   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)\r\n   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)\r\n   at Autofac.Core.Resolving.InstanceLookup.<Execute>b__0()\r\n   at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)\r\n   at Autofac.Core.Resolving.InstanceLookup.Execute()\r\n   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)\r\n   at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)\r\n   at Autofac.Core.Activators.Reflection.AutowiringParameter.<>c__DisplayClass2.<CanSupplyValue>b__0()\r\n   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()\r\n   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)\r\n   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)\r\n   at Autofac.Core.Resolving.InstanceLookup.Execute()\r\n   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)\r\n   at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)"}

Local server is .NET 4.5, remote server is .NET 4.0.

Is that the problem? Have no privileges on the remote box so haven't been able to test that theory.

Thanks.

Alex Meyer-Gleaves

unread,
May 30, 2013, 5:01:59 AM5/30/13
to aut...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages