所以我几个月来一直在为我们的应用程序使用ServiceStack并且没有遇到任何问题。但是在过去的几天里,当我运行我的应用程序时,我遇到了这个奇怪的异常。但是,只有当我在物理iOS设备上运行时才会出现此错误,模拟器工作正常并且异常永远不会显示。这是我目前正在获得的例外
{ServiceStack.WebServiceException: Bad Request ---> System.Runtime.Serialization.SerializationException: Type definitions should start with a '{', expecting serialized type 'ErrorResponse', got string starting with: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"" at ServiceStack.Text.Common.DeserializeTypeRefJson.StringToType
这是对整个例外https://gist.github.com/anonymous/cf4ee3716abf4562fe1a
的要点我之前从未遇到过这方面的问题,我期待的对象类型是KeyValuePair<LoginTypes, Profile>
类型,其中LoginTypes
被定义为
public enum LoginTypes
{
LoginSuccessful,
AccountCreationSuccessful,
LinkSuccessful,
Fail,
}
Profile
定义为
public class Profile
{
public string Id { get; set; }
public string Bio { get; set; }
public string Email { get; set; }
public string Uuid { get; set; }
public string Photo { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string FacebookUUID { get; set; }
public string LinkedinUUID { get; set; }
public string TwitterUUID { get; set; }
public string FacebookURL { get; set; }
public string TwitterURL { get; set; }
public string LinkedinURL { get; set; }
public string DeviceToken { get; set; }
public string Password { get; set; }
public string PhoneNumber { get; set; }
public string TwitterScreenName { get; set; }
public bool IsPrivate { get; set; }
public string JobTitle { get; set; }
public string JobDescription { get; set; }
}