Windows Azure Data Services and WCF V3

My question is,
why does it WCF Data Services 5.2.0

work under the Azure Emulator and not in the Azure Staging / Production environment?

I am getting this error on the server:

Could not load file or assembly Microsoft.Data.Services, Version = 5.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

instead it works fine on the emulator.

My project link assemblies:

  • Microsoft.Data.Services 5.2.0.0
  • Microsoft.Data.Services.Client 5.2.0.0
  • Microsoft.Data.OData 5.2.0.0
  • Microsoft.Data.Edm 5.2.0.0
  • System.Spatial 5.2.0.0
  • Microsoft.WindowsAzure.Storage 2.0.0.0

V3 is very useful to show data in JSON without other libraries.

+3


source to share


1 answer


The problem might be because the .svc file has a hard-link to the GACed version: 5.0.0.0

<%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory, Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Service="Forward.TestService " %>

      



If your dlls have Copy Local attribute set to true, you should be able to remove the version and fix the problem.

<%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory, Microsoft.Data.Services, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Service="Forward.TestService " %>

      

+3


source







All Articles