TestServer HttpClient SendAsync returns NOT_FOUND when api is in classLibrary #10331
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
The exact same controller works when it is in the main application OR in a class library.
i.e.
https://localhost:5001/api/SomeThing2/dog
However, when called from TestServer's HttpClient it returns a 404 when the SomeThing2 controller is in a class library. Cut and paste the controller back to the main application results in TestServer's HttpClient returning a 200.
To Reproduce
minimal project
or
AzurePipelinesDemoAspNetCore
Currently, it is failing my tests when the Something2 is an external project
https://github.com/P7CoreOrg/AzurePipelinesDemoAspNetCore/blob/master/src/SomeThing2/Controllers/SomeThing2Controller.cs
Cut and Paste the SomeThing2Controller to the following location;
https://github.com/P7CoreOrg/AzurePipelinesDemoAspNetCore/tree/master/src/TheWebApp/Controllers
which is in the main app make everything work.
https://github.com/P7CoreOrg/AzurePipelinesDemoAspNetCore/blob/master/src/xUnit_TheWebAppTests/UnitTestSomeThing.cs
Expected behavior
Should not return a 404 when SomeThing2Controller is in a separate classlibrary.
The text was updated successfully, but these errors were encountered: