【问题标题】:Silverlight RIA Services Complex Type Error On Server服务器上的 Silverlight RIA 服务复杂类型错误
【发布时间】:2011-08-16 19:59:05
【问题描述】:

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

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 调用的包装器,而不是实体对象。

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

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

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

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

谢谢 奎乔恩

【问题讨论】:

    标签: silverlight ria


    【解决方案1】:

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

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

    msiexec /i RiaServices.msi SERVER=TRUE

    【讨论】:

    • 这可行,但是为了使我们的 IIS 服务器尽可能通用,我们进行 BIN 部署,因此我们不必安装和管理这些类型的框架。
    • 我们在部署到客户系统时遇到了类似问题,但由于仅安装了 RIA 服务 1.0 而失败并出现此错误。我们的案例更有趣,因为一些服务有效,而另一些则无效(取决于签名是否需要 SP1)。似乎在系统上安装它会覆盖文件的 bin 部署,您需要卸载 1.0 或安装 SP1。
    【解决方案2】:

    所以这就是问题所在。

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

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

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

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

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

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

    感谢大家的回复...

    【讨论】:

      猜你喜欢
      • 2011-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多