build failed
C:\Users\lalli\MyApp\Program.cs(2,1): error CS8802: Only one compilation unit can have top-level statements. [C:\Users\lalli\MyApp\MyApp.csproj]
The build failed. Fix the build errors and run again.
Hello @lallikrishna, could you please check that you don't have another files in your project with top-level statements? You may find more examples here https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9#top-level-statements
Sometimes I've seen this happened when the dotnet new command is run twice, once at the user's folder (at C:\users\lalli) and then another time after the user has done cd MyApp. You could delete the MyApp folder and start over.