If you are using API Tests with the WebApplicationFactory you might did something like this to have a public Program class: public partial class Program;No more!