开发者

Silverlight Ria Services Service Error - But only in prodcution

开发者 https://www.devze.com 2023-02-05 21:18 出处:网络
I have a silverlight Ria Services application that exposes 4 different Domain Services.Everything works great on the local machine, but when I deployed to the server, I was getting strange errors.I de

I have a silverlight Ria Services application that exposes 4 different Domain Services. Everything works great on the local machine, but when I deployed to the server, I was getting strange errors. I decided to navigat to each service to make sure they were up and working. All of them responded with the standard service p开发者_JS百科age except for one. This is the error I get when I navigate to the service with a browser:

Operation named 'GetTagCount' does not conform to the required signature. Return types must be an entity, collection of entities, or one of the predefined serializable types.

GetTagCount is not returning an entity, but a custom object. Here is the method:

 [Invoke]
public IEnumerable<TagCount> GetTagCount(long custodian)
{
  var query =
      from tag in this.ObjectContext.Tags
      join docs in this.ObjectContext.TaggedDocuments.Where(d => d.CustodianId == custodian)
      on tag.TagId equals docs.TagId
      into tagGroup

      orderby tagGroup.Count() descending
      select new TagCount
      {
        TagId = tag.TagId,
        TagDescription = tag.Description,
        DocCount = tagGroup.Count(),
        ImageId = tag.ImageId
      };

  return query;
}

The TagCount class is a basic class with 4 public properties. Why would this work in Debug and not on the server. And more importantly, what do I need to do to fix it?

EDIT: This is a Silverlight 4.0 app

Thanks,

-Scott


I found out what the problem was. I forgot I had installed Ria Services SP1 Beta on my development machine which adds support for complex types. I had not yet installed the service pack on the production server. Once installed, everything worked like it should.

I hope this helps someone else...

-Scott

0

精彩评论

暂无评论...
验证码 换一张
取 消