Skip to content

Same function names in multiple namespaces is unsupported #151

Closed
@lkingsford

Description

@lkingsford

Per https://github.com/Microsoft/aspnet-api-versioning/wiki/How-to-Version-Your-Service, you should be able to create multiple versions of a controller by splitting them over multiple name-spaces, and using the same names. v2.1.0 is failing at this, and producing (for my case at least) the following error:

{
    "Message": "An error has occurred.",
    "ExceptionMessage": "Multiple types were found that match the controller named 'GetWebserviceVersion'. This can happen if the route that services this request ('api/v{version:apiVersion}/wsversion') found multiple controllers defined with the same name but differing namespaces, which is not supported.\r\n\r\nThe request for 'GetWebserviceVersion' has found the following matching controllers:\r\nPSConnectWS.PSConnect_5_0.GetWebserviceVersionController\r\nPSConnectWS.PSConnect_4_0.GetWebserviceVersionController",
    "ExceptionType": "System.InvalidOperationException",
    "StackTrace": "   at System.Web.Http.Dispatcher.DefaultHttpControllerSelector.SelectController(HttpRequestMessage request)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}

This directly contradicts the documentation.

I can provide a code example if necessary.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions