ServiceStack添加参考DTO问题

时间:2015-11-10 11:34:11

标签: servicestack

我正在使用VS2012和ServiceStack 4.0.46。我已经设置了一个按预期工作的Web服务。我现在需要设置第二个Web服务,它可以调用第一个。

在我的第二个Web服务中,我尝试将ServiceStack引用添加到第一个服务。这主要适用于我创建的文件

using ; 

这是

{{1}}

导致我出问题的行

我在原始网络服务中检查了DTO,似乎没有任何故障。如果我删除上面的行,则在保存文件时会再次出现。

我显然做错了什么,但我不确定如何弄明白

1 个答案:

答案 0 :(得分:1)

After some investigation I have discovered the root cause of this issue, it was, as I originally suspected, my fault. I tracked it down to one particular Service and it turned out that the get method was using the wrong class, which happened to have the same name, as the intended request DTO.

So I had

Public Class HonorificService
    Inherits ServiceStack.Service

    Public Function [Get](request As Honorific) As Object

When I should have had

Public Class HonorificsService
    Inherits ServiceStack.Service

    Public Function [Get](request As Lookups.Honorific) As Object