You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chapter: 4
Page Number: 171
Section Title: Hot reloading during development
Step Number: 3
Problem to fix: The example code on p.171 raises an exception if the C# file does not use top-level statements:
while(true){WriteLine("Hello, Hot Reload!");awaitTask.Delay(2000);}
When running the code, the compiler returns: "There were build errors. Would you like to continue and run the last successful build?". Additionally, VS produces the following CS5001 error message: "Program does not contain a static 'Main' method suitable for an entry point".
Suggested solution: If we want not to use top-level statements, we need to modify the Main() method:
staticasyncTaskMain(string[]args)
Other useful information e.g. OS, coding tools, and so on: Windows 10, VS 2022, VSC 1.77.3
Thank you 😉
The text was updated successfully, but these errors were encountered:
Chapter: 4
Page Number: 171
Section Title: Hot reloading during development
Step Number: 3
Problem to fix: The example code on p.171 raises an exception if the C# file does not use top-level statements:
When running the code, the compiler returns: "There were build errors. Would you like to continue and run the last successful build?". Additionally, VS produces the following CS5001 error message: "Program does not contain a static 'Main' method suitable for an entry point".
Suggested solution: If we want not to use top-level statements, we need to modify the
Main()
method:Other useful information e.g. OS, coding tools, and so on: Windows 10, VS 2022, VSC 1.77.3
Thank you 😉
The text was updated successfully, but these errors were encountered: