-
Notifications
You must be signed in to change notification settings - Fork 2.1k
ActionResults returned from controller actions rendered as JSON, instead of executed #4960
Comments
The incorrect behavior is new to 1.0 RTM, and used to work fine in RC2. |
Yep, this is definitely not intended. Thanks for the repro |
I updated the repro code to test other ActionResult subclasses. Here are the test URLs and results:
|
The problem is here and here. Both of these cases should have a conditional cast to
Should change to:
If you want a workaround, I'd suggest the following:
|
@rynowak thank you for the workaround, will test and report back. |
@rynowak looking at the code you linked to, it seems both cases deal with non-async method return values. The code I posted is a minimal repro derived from an actual project where all actions are async, and those are affected as well. Thought I should mention this now to avoid a partial fix. |
Lines 641- 648 is the synchronous case. The fix for that case is the same as the sample I provided. This code has had a lot of perf work done on it, so it's a little confusing 😆 |
@rynowak workaround confirmed, thank you! |
/cc @Eilon @DamianEdwards FYI |
@javiercn @Eilon @danroth27 The issue was reported three weeks ago but the fix is not yet merged. Is there still a chance of this making it into v1.0.1 or v1.1.0? |
It's currently slated to be fixed in 1.1.0 |
Done? |
…d as json instead of executed
Steps to reproduce
Open http://localhost:5000/ in your browser.
Expected results
The page displays
{"a":"test"}
, i.e. only the ObjectResult value is returned to the client.Actual results
The page displays
{"value":{"a":"test"},"formatters":[],"contentTypes":[],"declaredType":null,"statusCode":null}
instead, i.e. all the properties ofObjectResult
are returned to the client, not just the value.The text was updated successfully, but these errors were encountered: