1
votes

Simular issue: WCF Data Service deployment issues

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)

We are using the follow ddl
Microsoft.Data.Edm.dll 5.2.0.51212
Microsoft.Data.OData.dll 5.2.0.51212
System.Spatial.dll 5.2.0.51212

We have checked the files on the server, there all there. The versions are the same

Still have no clue what it could be... Idea's?

Thanks !

1

1 Answers

0
votes

Solved...

First install:

Install-Package Microsoft.Data.Services -Version 5.2.0

In your web.config add:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Data.Services" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.2.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

And last, Remove all unnessary information in your connecting from metadata so you will end up like this:

<add name="MobileDataPlatformEntities" connectionString="metadata=res://*/; etc...