Route parameter TryParse checks does not handle handler parameters with [FromRoute] attribute where name is provided. #45581
Labels
analyzer
Indicates an issue which is related to analyzer experience
old-area-web-frameworks-do-not-use
*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Is there an existing issue for this?
Describe the bug
Given the following example:
... the recently added Roslyn analyzer fails to warn that
MyRouteObject
does not have aTryParse(...)
method. This results in a runtime error when this code is run.Expected Behavior
We should raise an analyzer warning on the handler parameter because it's a route parameter that does not implement
TryParse
.Steps To Reproduce
See above.
Exceptions (if any)
At runtime we get the following exception:
.NET Version
8.0.100-alpha.1.22613.3
Anything else?
No response
The text was updated successfully, but these errors were encountered: