In the project’s General Properties, specify Class2 as the ‘Startup Object’. The dropdown contains all classes with a Main method specified.