Program does not contain a static 'Main' method suitable for an entry point
This happens with new downloaded project - anyone able to know how to resolve?
ASP.NET CORE & Angular (single solution)
.NET7
v12.0.1
Many Thanks
5 Answer(s)
-
0
Hi,
Could you check this document https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation?view=net-maui-7.0&tabs=vswin to see if you have anything missing for running the MAUI app ? This can be caused by a missing workload installation or old version of Visual Studio.
Thanks,
-
0
Any resolution to this? I am running Visual Studio 2022 17.5.1 with all workloads according the the article and I am still getting these 2 errors.
I also have tested the .NET Maui "Hello World" app and it works fine.
-
0
How does this support forum work? My company paid for ASP.NET Zero and we are supposed to get a year of support. I am still wrestling with this issue. Can someone please provide assistance?
-
1
The MAUI project only includes iOS and Android platforms.
You get the error "Program does not contain a static 'Main' method suitable for an entry point" if you are trying to run it under Windows.
It will work on Windows, if you target Android.
-
0
Thank you very much @edarib!
For anyone who wonders what to do:
-
Right-click project
YourProjectName.Mobile.MAUI
. -
Click on
Properties
. -
There under
Application -> Android Targets
click the checkboxTarget the Android platform
.
You may need to clean your solution and rebuild it. If cleaning fails just restart Visual Studio and try again.
I hope this helps!
-