後大約一天的時間和搜索(並重新應用VS2008 SP1)的一半,該博客文章的最後茅塞頓開:
Astoria V.Next Ships for .NET 3.5 SP1 -> Versioning Issue
原來一切都很好,我的安裝,但我不得不跳過因爲InitilizeService()方法的簽名曾經如此微妙地改變過。斯蒂芬表示復地在他的博客:
1: //change the IDataServiceConfiguration to DataServiceConfiguration
2: public static void InitializeService(DataServiceConfiguration config)
3: {
4: config.SetEntitySetAccessRule("*", EntitySetRights.All);
5: //take advantage of the "2.0" features
6: config.DataServiceBehavior.MaxProtocolVersion =
7: System.Data.Services.Common.DataServiceProtocolVersion.V2;
8: }
The first thing that you need to change is on line 2, change the interface IDataServiceConfiguration to be just DataServiceConfiguration (I am sure that there is a better way to do this, I have not figured it out yet.). Next, set the MaxProtocolVersion property of DataServiceBehavior to V2. After that you can take advantage of all the new features!
重點煤礦。簡單的「我」造成的差異真是太棒了。要回答斯蒂芬的關注,這也是MSDN備份,但是他們目前不參考接口VS實施對象指出的區別:
Configuring the Data Service (ADO.NET Data Services)
下面是VB代碼:
'change the IDataServiceConfiguration to DataServiceConfiguration
Public Shared Sub InitializeService(ByVal config As DataServiceConfiguration)
config.SetEntitySetAccessRule("*", EntitySetRights.All)
'take advantage of the "2.0" features
config.DataServiceBehavior.MaxProtocolVersion = System.Data.Services.Common.DataServiceProtocolVersion.V2
End Sub
編譯,測試並通過。我剛剛踏出了一個更大的世界......