0

Hi I have a silverlight4 + .net 4.0 application where i am using self tracking entities. In the application i have a silverlight project which contains the entities generated by EF self tracking template. This project is being shared by the wcf service and the client so that the change tracking works. everything builds fine but when i run my service is get the exception Could not load file or assembly 'System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

any help is much appretiated

thanks Ben

4

2 回答 2

0

Silverlight 以及 STE 组件的正确版本是:

// Assembly System.Runtime.Serialization, Version 2.0.5.0
Location: C:\Program Files (x86)\Microsoft Silverlight\4.0.60129.0\System.Runtime.Serialization.dll 
Name: System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e 
Type: Library 

如果您引用了 v2.0.50727,则您尚未加载 silverlight 版本,但 .NET 2.0 版本将具有如下签名:

// Assembly System.Runtime.Serialization, Version 2.0.0.0
Location: C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Runtime.Serialization.dll 
Name: System.Runtime.Serialization, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Type: Library 
于 2011-04-04T06:25:41.000 回答
0

必须使用映射到客户端的实体创建一个单独的项目。所以 2 个项目包含相同的实体。一个映射到服务器,一个映射到客户端,每个都使用不同版本的序列化 dll

于 2011-04-12T21:04:05.327 回答