c# - ServiceStack EnryptedClient 使用 IReturnVoid DTO 错误

标签 c# .net servicestack httpserver

我的服务有一个像这样的 EncryptedClient

_jsonClient = new JsonServiceClient(baseUrl);
string publicKeyXml = _jsonClient.Get(new GetPublicKey());
_encryptedCient = _jsonClient.GetEncryptedClient(publicKeyXml);
_encryptedCient.SessionId = authResponse.SessionId;

和 DTO

public class AlarmNotification : IReturnVoid, IHasSessionId
{
    public string SessionId { get; set; }
}

当我调用时,服务中的处理程序方法并不重要

_encryptedCient.Send(new AlarmNotification { });

它到达服务器,请求被正确处理,但在服务完成处理后,我得到 ArgumentNullException,指出某个名为“s”的字符串引用了 null。如果我使用除 IReturnVoid 之外的任何其他返回类型,一切都会正常。欢迎任何关于为什么会发生这种情况的想法。

最佳答案

这是一个错误,现在应该是 resolved from this commit .

此更改从 v4.0.53 开始可用,现在是 available on MyGet .

关于c# - ServiceStack EnryptedClient 使用 IReturnVoid DTO 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35632952/

相关文章:

c# - Xamarin : iOS won't send punctuation in strings to a web endpoint

c# - MSTest 测试上下文异常处理

c# - Asp.net 中表单例份验证超时的单位是什么?

java - 需要初始化对象时使用的设计模式?

c# - 从网址下载 pdf 的最佳方法

c# - XML 反序列化仅适用于 xml 中的命名空间

c# - 在 .NET 4.0 中处理没有第三方库的 Zip 文件?

c# - 为什么 Microsoft 的这段示例代码会崩溃?

.net - 如何在与 Xamarin Android 兼容的 PCL 中解码 JWT

c# - 如何从 ServiceStack 查询返回图像?