我在核心应用程序( core 2.1,我使用的是服务堆栈5.2)中遇到了此异常.
未找到方法:"ServiceStack.Web.INameValueCollection ServiceStack.Web.IRequest.get_QueryString()".
它最初来自一个插件,但我不知道为什么.代码在此行上此处.
session.ReferrerUrl = GetReferrerUrl(authService,会话,请求);
顺便说一句,在应用程序控制台中,我也得到了这个提示:
警告:ServiceStack.Serialization.StringMapTypeDeserializer [0]类型"ServiceStack.Authenticate"上不存在属性重定向"
...但是我认为这与上面的异常无关.
有人暗示可能是个问题吗?
解决方案没有 IRequest上的INameValueCollection不再存在,去年被v5 +中的 NameValueCollection 取代,无论您使用的是哪个v4代码,都需要重新编译与项目其余部分的版本相同.
要进行彻底升级,请确保所有项目都引用相同的ServiceStack版本,删除您的/bin 和/obj 文件夹,然后再次尝试从NuGet还原./p>
如果仍然存在问题,请清除您的NuGet缓存,然后再次还原:
警告:ServiceStack.Serialization.StringMapTypeDeserializer [0]类型"ServiceStack.Authenticate"上不存在属性重定向"
这无关紧要,只是警告请求DTO上有一个 redirect 属性,我已将其添加到此提交.
nuget locals all -clearI come across this exception in my core app ( core 2.1 and I'm using service stack 5.2).
Method not found: 'ServiceStack.Web.INameValueCollection ServiceStack.Web.IRequest.get_QueryString()'.
It comes from one of the plugins originally, but I can't figure out why. Code breaks on this line here.
session.ReferrerUrl = GetReferrerUrl(authService, session, request);
Btw, in app console I also get this:
warn: ServiceStack.Serialization.StringMapTypeDeserializer[0] Property 'redirect' does not exist on type 'ServiceStack.Authenticate'
...but I don't think that's related to the exception above.
Any hints what might be a problem?
解决方案There is no INameValueCollection on IRequest anymore that was replaced last year with NameValueCollection from v5+, whatever v4 code you have that's using it needs to be recompiled with the same version as the rest of your project.
To get a clean upgrade make sure all your projects are referencing the same ServiceStack version, delete your /bin and /obj folders and try restoring from NuGet again.
If it’s still an issue clear your NuGet Cache and restore again:
warn: ServiceStack.Serialization.StringMapTypeDeserializer[0] Property 'redirect' does not exist on type 'ServiceStack.Authenticate'
This is irrelevant it's just a warning that there was a redirect property on Request DTOs, I've added it to the ignore list in this commit.
nuget locals all -clear
更多推荐
MissingMethodException get
发布评论