Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信登录在.NET CORE3.1下id4启动就报错。 #14

Open
codeman-git opened this issue Feb 7, 2020 · 4 comments
Open

微信登录在.NET CORE3.1下id4启动就报错。 #14

codeman-git opened this issue Feb 7, 2020 · 4 comments

Comments

@codeman-git
Copy link

codeman-git commented Feb 7, 2020

image
按照demo一猫一样写的,id4一起动就报错,把addwechat段删掉就没事了。

An unhandled exception occurred while processing the request.
MissingMethodException: Method not found: 'Void Microsoft.AspNetCore.Authentication.ClaimActionCollectionMapExtensions.MapCustomJson(Microsoft.AspNetCore.Authentication.OAuth.Claims.ClaimActionCollection, System.String, System.Func`2<Newtonsoft.Json.Linq.JObject,System.String>)'.
Microsoft.AspNetCore.Authentication.WeChat.WeChatOptions..ctor()

@loundar
Copy link

loundar commented Apr 18, 2020

同问,也是升级的时候遇到了这个问题,明明存在,却提示这个,感觉莫名其妙,求大神解答

@codeman-git
Copy link
Author

codeman-git commented Apr 20, 2020 via email

@Yukimir
Copy link

Yukimir commented May 27, 2020

这是因为.net core 3.1的asp.net core做了一些修改
具体在 OAuthTokenResponse.Success这个方法 和 new OAuthCreatingTicketContext的构造函数 上
在.net core 2当中这两个方法接受的参数是一个JObject
而.net core 3当中这两个方法接受的参数是一个JsonDocument
因为在.net core 3里微软不再使用JSON.NET作为JSON解析库,而是用自己的了

另外 wechat的库在options里还用了一个MapCustomJson
这里的委托传入的参数也一样改掉了

所以可以简单的fork一下然后在Options和Handler里面做一下条件编译

@robin8588
Copy link

很棒的项目,期待能在 .net core 3 里面使用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants