繁体   English   中英

Silverlight RIA 服务复杂类型服务器上的错误

[英]Silverlight RIA Services Complex Type Error On Server

我们正在尝试在没有 SP1 的旧服务器上运行带有 RIA 服务 SP1 的 Silverlight 4.0。 我们将所有 DLL 复制到本地 BIN 文件夹,复制本地设置为 True 并且特定版本设置为 True 但我们仍然在下面收到“复杂类型”错误。

WebHost failed to process a request.
 Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/7339810
 Exception: System.ServiceModel.ServiceActivationException: The service '/Linebacker/Services/FCSAmerica-Linebacker-Web-DomainServices-LinebackerDomainService.svc' cannot be activated due to an exception during compilation.  The exception message is: Operation named 'SearchCustomers' does not conform to the required signature. Return types must be an entity, collection of entities, or one of the predefined serializable types.. ---> System.InvalidOperationException: Operation named 'SearchCustomers' does not conform to the required signature. Return types must be an entity, collection of entities, or one of the predefined serializable types.
   at System.ServiceModel.DomainServices.Server.DomainServiceDescription.ValidateMethodSignature(DomainOperationEntry method)
   at System.ServiceModel.DomainServices.Server.DomainServiceDescription.AddInvokeOperation(DomainOperationEntry method)
   at System.ServiceModel.DomainServices.Server.DomainServiceDescription.Initialize()
   at System.ServiceModel.DomainServices.Server.DomainServiceDescription.CreateDescription(Type domainServiceType)
   at System.ServiceModel.DomainServices.Server.DomainServiceDescription.<>c__DisplayClass8.<GetDescription>b__7(Type type)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at System.ServiceModel.DomainServices.Server.DomainServiceDescription.GetDescription(Type domainServiceType)
   at System.ServiceModel.DomainServices.Hosting.DomainServiceHost..ctor(Type domainServiceType, Uri[] baseAddresses)
   at System.ServiceModel.DomainServices.Hosting.DomainServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)
   at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
   --- End of inner exception stack trace ---
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)

这就是我们的代码在域服务中的样子……它是围绕 WCF 调用而不是实体 object 的包装器。

    [Invoke]
    public IEnumerable<Customer> SearchCustomers(string searchValue)
    {
        return new List<Customer>();
    }

我们需要在主机服务器上安装 SP1 吗? 这会影响在那里运行的旧版本 Silverlight 吗? 我们是否缺少一个属性或什么?

我们基本上已经将本地的每个 dll 复制到主机 bin 文件夹中,并在我们开发机器上的库文件夹中引用了相同的内容。

事情在我们的开发机器上运行良好,但在服务器上却不行。

谢谢奎乔恩

尝试在未安装 WCF RIA Services 1.0 SP1 的服务器上使用 ComplexObjects 使用 WCF RIA 服务时,我遇到了同样的问题。 您的问题的简短回答是,是的,您需要在服务器上安装WCF RIA Services V1.0 SP1 它不应该影响那里运行的其他任何东西。

运行安装程序时,它可能会抱怨找不到 Visual Studio。 如果是这样,请退出安装程序,打开命令提示符,切换到包含RiaServices.msi安装程序的目录并运行以下命令:

msiexec /i RiaServices.msi SERVER=TRUE

所以这就是问题所在。

我们已经使用 RIA 构建并运行了复杂类型,在具有 RIA SP1 的本地开发机器上没有任何问题。

我们的部署包装了所有这些 DLL 并将它们部署到 IIS 在我们的开发 Web 服务器上,然后我们收到错误,它必须是受支持的类型,如实体。

因此,我们查看了开发服务器上的 GAC,并安装了旧版本的 RIA,并且在 GAC 中,它具有与我们的 IIS 安装部署的 SP1 相同的版本。

因此,GAC 覆盖了我们的 DLL,我们从未引用我们的解决方案部署的 SP1 dll。

由于我们不想在我们的 web 服务器上安装 RIA,而且这是原始 RIA 服务的“垃圾”安装,我们只是将其卸载,然后我们部署的 SP1 dll 被正确引用并且问题得到修复。

另一个解决方案是使用上面显示的命令行选项安装 RIA SP1。

谢谢大家的回复...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM