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, IDictionary
2 childTypes, IDictionary2 entitySets) at System.Data.Services.Providers.BaseServiceProvider.LoadMetadata() at System.Data.Services.DataService
1.CreateMetadataAndQueryProviders(IDataServiceMetadataProvider& metadataProviderInstance, IDataServiceQueryProvider& queryProviderInstance, BaseServiceProvider& builtInProvider, Object& dataSourceInstance) at System.Data.Services.DataService1.CreateProvider() at System.Data.Services.DataService
1.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