MissingMethodException get_QueryString

喜欢而已 提交于 2020-01-06 01:21:39

问题


I come across this exception in my .net core app (.net 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?


回答1:


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


来源:https://stackoverflow.com/questions/53001102/missingmethodexception-get-querystring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!