WCF Ria Operation не соответствует требуемой подписи - PullRequest
0 голосов
/ 13 января 2012

У меня довольно неотложное дело, и я буду признателен за любой ввод.

У меня есть DomainService, который определен таким образом, и все работает отлично (на компьютере разработчика и на сервере).

Public Function GetPrices() As IQueryable(Of Price)
Public Sub InsertPrice(ByVal Price As Price)
Public Sub UpdatePrice(ByVal currentPrice As Price)

Но когда я добавляю следующий метод, я получаю следующую ошибку на сервере (которая не возникает на компьютере разработчика)

<Invoke(HasSideEffects:=True)>
Public Sub SetSitePrices(ByVal SiteIds As IEnumerable(Of Short), p As Price)

Operation named 'SetSitePrices' does not conform to the required signature. Parameter types must be an entity type or one of the predefined serializable types.

[InvalidOperationException: Operation named 'SetSitePrices' does not conform to the required signature. Parameter types must be an entity type or one of the predefined serializable types.]
   System.ServiceModel.DomainServices.Server.DomainServiceDescription.ValidateMethodSignature(DomainOperationEntry method) +221051
   System.ServiceModel.DomainServices.Server.DomainServiceDescription.AddInvokeOperation(DomainOperationEntry method) +21
   System.ServiceModel.DomainServices.Server.DomainServiceDescription.Initialize() +312
   System.ServiceModel.DomainServices.Server.DomainServiceDescription.CreateDescription(Type domainServiceType) +216
   System.ServiceModel.DomainServices.Server.<>c__DisplayClass8.<GetDescription>b__7(Type type) +9
   System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +72
   System.ServiceModel.DomainServices.Server.DomainServiceDescription.GetDescription(Type domainServiceType) +196
   System.ServiceModel.DomainServices.Hosting.DomainServiceHost..ctor(Type domainServiceType, Uri[] baseAddresses) +250
   System.ServiceModel.DomainServices.Hosting.DomainServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +29
   System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +422
   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1461
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +651

[ServiceActivationException: The service '/Services/Cosmo-Web-SamDomainService.svc' cannot be activated due to an exception during compilation.  The exception message is: Operation named 'SetSitePrices' does not conform to the required signature. Parameter types must be an entity type or one of the predefined serializable types..]
   System.Runtime.AsyncResult.End(IAsyncResult result) +688590
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190
   System.ServiceModel.Activation.ServiceHttpHandler.EndProcessRequest(IAsyncResult result) +6
   System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +96

Возможно ли, что на сервере есть разные WCFDLL файлы?

1 Ответ

1 голос
/ 26 августа 2012

Причина ошибки связана со старой версией RIA Services, установленной в GAC. В последнем пакете обновления RIA Services используется тот же номер версии, и это привело к загрузке версии в GAC по сравнению с более новой версией в каталоге bin.

Решение состоит в том, чтобы удалить службы RIA с сервера, что позволит загружать локальную версию \ BIN.

...