0
votes

I've developed an ASP .NET MVC 4 application that uses Entity Framework and a service WCF Data Services.

Everything works well offline. When I deploy my application on Windows Azure Cloud Services, my website and database work perfectly, but when I try to reach my WCF service appending "/MyserviceName.svc/" at the end of the url, I get the following error:

The server encountered an error processing the request. The exception message is 'The type initializer for 'System.Data.Services.Providers.ResourceType' threw an exception.'. See server logs for more details. The exception stack trace is: at System.Data.Services.Providers.ResourceType.get_PrimitiveResourceTypeMap() at System.Data.Services.Providers.ObjectContextServiceProvider.PopulateMetadata(IDictionary2 knownTypes, IDictionary2 childTypes, IDictionary2 entitySets) at System.Data.Services.Providers.BaseServiceProvider.LoadMetadata() at System.Data.Services.DataService1.CreateMetadataAndQueryProviders(IDataServiceMetadataProvider& metadataProviderInstance, IDataServiceQueryProvider& queryProviderInstance, BaseServiceProvider& builtInProvider, Object& dataSourceInstance) at System.Data.Services.DataService1.CreateProvider() at System.Data.Services.DataService1.HandleRequest() at System.Data.Services.DataService`1.ProcessRequestForMessage(Stream messageBody) at SyncInvokeProcessRequestForMessage(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

I have searched for a solution, I saw forums saying that I should add System.Spartial.dll, Odata.dll and Edm.dll on my project, but I already have these libraries into my project.

So, how could I fix that ?

Thanks in advance, DevCrosser

1

1 Answers

1
votes

Try marking the assemblies as "Copy local" in your project before you deploy

It's possible they're not being copied to the server