Reputation: 33
My question is:
why does WCF Data Services 5.2.0
work under Azure Emulator and not under Azure Staging/Production environment?
I get this error on 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's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
instead on emulator it works perfectly..
My project reference assemblies are:
V3 is very useful to show data in JSON without other libraries.
Upvotes: 3
Views: 1072
Reputation: 858
The problem can be related to the fact that in the .svc file there is an hardcoded reference 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 version and solve the problem
<%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory, Microsoft.Data.Services, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Service="Forward.TestService " %>
Upvotes: 3