admin管理员组文章数量:1122832
We have an existing API project and being intriguied by Aspire decided to try and add it to our solution. This seems to have worked okay and the dashboard launches with our api listed, however, every request returns with a http 200 repsonse and empty content.
It seems to be handling the endpoints correctly as any incorrect ones are returned with a 401 (which is how it's always worked).
The logs from the project are showing that the api is hit, howver, it doesn't return the correct data. As a test I've setup this endpoint
app.MapGet("/test", () => { return "test"; }).AllowAnonymous();
this is from the logs:
Request starting HTTP/1.1 GET https://localhost:7122/test - - -
Request finished HTTP/1.1 GET https://localhost:7122/test - 200 0 - 6.7426ms
and the postman response:
GET https://localhost:7122/test
200
11 ms
Warning: Unable to verify the first certificate
GET /test HTTP/1.1
User-Agent: PostmanRuntime/7.42.0
Accept: */*
Postman-Token: f8286ede-50e6-4e49-9543-f3b628577b7f
Host: localhost:7122
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
HTTP/1.1 200 OK
Content-Length: 0
Date: Thu, 21 Nov 2024 12:17:13 GMT
Server: Kestrel
(note the cerificate warning has been there since ever and doesn't normally affect the operation)
I'm not sure if there's something I'm missing, that I haven't configured properly or have made an obvious mistake....
EDIT:
It seems that in the newly added code for AddServiceDefaults
there is a resilience strategy added http.AddStandardResilienceHandler();
. Disabling this for now remedies the issue.
We have an existing .net API project and being intriguied by Aspire decided to try and add it to our solution. This seems to have worked okay and the dashboard launches with our api listed, however, every request returns with a http 200 repsonse and empty content.
It seems to be handling the endpoints correctly as any incorrect ones are returned with a 401 (which is how it's always worked).
The logs from the project are showing that the api is hit, howver, it doesn't return the correct data. As a test I've setup this endpoint
app.MapGet("/test", () => { return "test"; }).AllowAnonymous();
this is from the logs:
Request starting HTTP/1.1 GET https://localhost:7122/test - - -
Request finished HTTP/1.1 GET https://localhost:7122/test - 200 0 - 6.7426ms
and the postman response:
GET https://localhost:7122/test
200
11 ms
Warning: Unable to verify the first certificate
GET /test HTTP/1.1
User-Agent: PostmanRuntime/7.42.0
Accept: */*
Postman-Token: f8286ede-50e6-4e49-9543-f3b628577b7f
Host: localhost:7122
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
HTTP/1.1 200 OK
Content-Length: 0
Date: Thu, 21 Nov 2024 12:17:13 GMT
Server: Kestrel
(note the cerificate warning has been there since ever and doesn't normally affect the operation)
I'm not sure if there's something I'm missing, that I haven't configured properly or have made an obvious mistake....
EDIT:
It seems that in the newly added code for AddServiceDefaults
there is a resilience strategy added http.AddStandardResilienceHandler();
. Disabling this for now remedies the issue.
1 Answer
Reset to default 0As per the edit
It seems that in the newly added code for AddServiceDefaults there is a resilience strategy added http.AddStandardResilienceHandler();. Disabling this for now remedies the issue.
本文标签: aspnet coreNet Aspire 9To existing ProjectAlways returns empty 200 reponsesStack Overflow
版权声明:本文标题:asp.net core - .Net Aspire 9 - To existing Project - Always returns empty 200 reponses - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736310994a1934579.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论