Closed
Description
I have a class library containing a Controller currently working on 2.0. I'm in the process of migrating things over to 3.0 using preview 9.
My class library has a test project that sets up things using WebApplicationFactory. In 2.0 the controller in my class library was automatically discovered. With the new routing system, it cannot find the path handled by the controller.
This is how I've set things up in the test project. Am I missing something?
protected override void ConfigureWebHost(IWebHostBuilder webhostBuilder)
{
webhostBuilder
.UseContentRoot(Directory.GetCurrentDirectory())
.UseDefaultServiceProvider(p => p.ValidateScopes = true)
.ConfigureServices((context, services) =>
{
services.AddControllers();
})
.Configure(appBuilder =>
{
appBuilder.UseRouting();
appBuilder.UseEndpoints(config =>
{
config.MapControllers();
});
});
}
´´´