You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This behavior occurs because although the correct controller type is selected, the action binding is paired to a method from the incorrect candidate controller. For example, api/helloworld?api-version=3.0 selects Example.V3.HelloWorldController, but binds the action to Example.V1.HelloWorldController.Get. This behavior only appears to manifest for attribute-routed controllers and only if the controllers also have the same name.
The text was updated successfully, but these errors were encountered:
Synopsis
When versioned controllers that use attribute routing with the same name, but in different namespaces, an InvalidCastException is thrown.
For example:
Analysis
This behavior occurs because although the correct controller type is selected, the action binding is paired to a method from the incorrect candidate controller. For example,
api/helloworld?api-version=3.0
selectsExample.V3.HelloWorldController
, but binds the action toExample.V1.HelloWorldController.Get
. This behavior only appears to manifest for attribute-routed controllers and only if the controllers also have the same name.The text was updated successfully, but these errors were encountered: