When I try to run the .NET Core sample program on my MAC. on VScode.
On Terminal is ok.
bogon:projectApp JCNetwork-Mecil9$ dotnet run
Project projectApp (.NETCoreApp,Version=v1.1) was previously compiled. Skipping compilation.
What is your name?
mecil9
Hello, mecil9, on 12/10/2016 at 17:11
but on VSCode ,throw out the error:
What is your name?
mecil9
Unable to perform this action because the process is running.
VS Code maintains a debug session while the program is running, and pressing the Stop button terminates the program.
In Visual Studio Code, use shortcut Ctrl + Shift + P to open the Command Palette and type Open launch. json . And it will open the launch. json file for you.
The reason why that is happening is because, you are trying to use the debug console as a terminal to your application and at the time you entered an input, it was already running a process which is your application. So in simple terms, what it is trying to tell you is that, 'I can't do what you are asking me to do now because I'm already running a program'. What you need to do for your console app to run is that, press Ctrl + Shift + D to open the Debug section. At the top, you will find a gear sign which opens a file called 'launch.json'. Search for "externalConsole" and change it from false to true. This will open a console window for you to allow for input. Hope that answers your question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With