@Timon Yang-MSFT ,@Viorel , Thanks for your comments! As for @Viorel 's question, nothing is changed after my code was simplified such as "Hello World!"
I found one issue: I created this project which was not for .NET framework. What I created was for running .NET Core on Windows, Linux, macOS. After creating a console project for .NET Framework, my code works. It seems like creating the wrong project caused this issue even though it is not straightforward solution.