✅ I cant start playwright browser
I cannot run the browser on Playwright, my code closes without throwing an error.
code
https://hatebin.com/rovbvubawd
7 Replies
I think it's probably related to you having a non-async Main calling an async method
e.g.:
and see if it runs
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
But Console.writeline at the end not working
that worked thx i dont know main function can be a task
$mains
The possible signatures for
Main
are public
is not required (can be any accessibility).
Top-level statements are compiled into a Main
method and will use an appropriate signature depending on the body.
https://docs.microsoft.com/en-US/dotnet/csharp/fundamentals/program-structure/main-command-lineMain() and command-line arguments - C#
Learn about Main() and command-line arguments. The 'Main' method is the entry point of an executable program.
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
TLDR on
async
/await
:
* every .net API that is suffixed with Async
(eg: .Read()
and .ReadAsync()
) => use the Async
version
* if the API name ends with Async
=> await
it
* if the API returns a Task
=> await
it
* if you have to await
in a method:
* that method must have the async
keyword (you could even suffix your function name with Async
, up to you)
* if it was returning T
(eg:string
) => it should now return Task<T>
(eg: Task<string>
)
* APIs to ban and associated fix: