Skip to content

Instantly share code, notes, and snippets.

@ApoTheOne
Last active July 31, 2019 07:54
Show Gist options
  • Save ApoTheOne/4c71622e929470f490b21da67b461607 to your computer and use it in GitHub Desktop.
Save ApoTheOne/4c71622e929470f490b21da67b461607 to your computer and use it in GitHub Desktop.
Gotchas .Net Core
Taken from: https://elanderson.net/2018/03/refit-basics/
In order to use async Task Main a change is needed to the project file to set the LangVersion.
I just set it to latest, but I believe the minimum for this feature is 7.1.
```xml
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
```
If you are using VS Code and are using Console.ReadLine() like I am above then a change will be
needed for the launch.json file found in the .vscode directory.
Look for the console property and set the value to either integratedTerminal or externalTerminal
otherwise, the app will be connected to the debug console which will show the output of the application, but doesn’t allow for input.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment