Replace:
builder.Services.AddControllers()
with
var assembly = typeof(WeatherForecastController).Assembly;
builder.Services.AddControllers()
.PartManager.ApplicationParts.Add(new AssemblyPart(assembly));
See also: "How to use a controller in another assembly in ASP.NET Core MVC 2.0 ?"