You can have multiple files with Main()
but as noted above, you can only build and run 1 at a time.
In your project file .csproj
file
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<!-- set your startup object -->
<StartupObject>CodeHouse.Test</StartupObject>
</PropertyGroup>
The above will run your Test
console. To build/run your Program
change <StartupObject>
accordingly.
So end of the day, its really just one "app" (at a time), whatever use case you may have. I personally do this only for organizing some quick scripts/hacks in one physical location/folder/repo.
Hth..
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…