Yesterday I blogged about how to get started with integration testing in ASP.NET Core.
If you are using this technique, you might get a few issues while migrating from .NET Core 2.2 to .NET Core 3.0 or 3.1.
It could be that you get the following error message:
No method 'public static IHostBuilder CreateHostBuilder(string[] args)' or 'public static IWebHostBuilder CreateWebHostBuilder(string[] args)' found on 'AutoGeneratedProgram'. Alternatively, WebApplicationFactory`1 can be extended and 'CreateHostBuilder' or 'CreateWebHostBuilder' can be overridden to provide your own instance.
You should use the
CreateHostBuilder()
method. It is still possible to access the WebHostBuilder
through the ConfigureWebHostDefault()
method: