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

GetServicesOfServer 查询服务列表 会报错The node must be of type 'JsonValue'. #337

Open
HeHoney opened this issue Nov 20, 2024 · 1 comment

Comments

@HeHoney
Copy link

HeHoney commented Nov 20, 2024

var result="{"count":2,"doms":["gateway","occ"]}"
var json = System.Text.Json.Nodes.JsonNode.Parse(result).AsObject();
var count = json["count"]?.GetValue() ?? 0;
var data = json["doms"]?.GetValue<List>() ?? new List();

“json["doms"]?.GetValue<List>()”引发了类型“System.InvalidOperationException”的异常
Data: Count = 0
HResult: -2146233079
HelpLink: null
InnerException: null
Message: "The node must be of type 'JsonValue'."
Source: "System.Text.Json"
StackTrace: " 在 System.Text.Json.Nodes.JsonNode.GetValueT"
TargetSite: {T GetValueT}

@catcherwong
Copy link
Collaborator

用的nacos server 版本是多少?

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

2 participants