Check in you *.csproj for this one:
<OutputType Condition="'$(TargetFramework)' != 'net9.0'">Exe</OutputType> Similar to: Program does not contain a static 'Main' method suitable for an entry point In .Net MAUI Xunit
<OutputType Condition="'$(TargetFramework)' != 'net9.0'">Exe</OutputType>