我刚刚从ServiceStack 4.0.24更新到4.0.50但是现在尝试会话时会引发InvalidCastException
return this.SessionAs<ScadaSession>();
其他信息:无法转换类型&#39; ServiceStack.AuthUserSession&#39;输入&#39; Scada.Web.ServiceInterface.ScadaSession&#39;。
项目中唯一的其他更改是更新许可证密钥以允许我使用较新的版本。我已经阅读了发行说明,但我看不到有任何标志性的变化似乎会影响到我,但是如果有新的东西我必须添加到我的ScadaSession课程中没有任何继承,非常感谢建议。
答案 0 :(得分:2)
您需要注册注册AuthFeature插件时使用的自定义会话类型,例如:
Plugins.Add(new AuthFeature(() => new ScadaSession(),
new IAuthProvider[] { ... }));
您的ScadaSession
还需要继承AuthUserSession
(如果它还没有)。