Reputation: 1069
Possibly a repeat or very basic question...
I have recently downloaded Visual Studio Code on Windows and tried to open my existing "Hello World!!" console application.
I have downloaded the C# extension for the same.
Could you please point me to documentation where I can find step-by-step guide for configuring VS Code so that I can open existing console app and debug/ run the same.
Currently when I opened my existing C# project written using VS2013 and tried to debug/ run, it is not working. I'm getting following error. "The preLaunchTask 'build' terminated with exit code 1."
Or am I trying to do something which is not correct at all??
Upvotes: 4
Views: 5571
Reputation: 52366
You can use .NET Core. Here are some instructions to run a basic C# console app in Visual Studio Code.
Download .NET Core here and install it. https://dotnet.microsoft.com/download
Open command prompt, and change to the folder where you want to create your app.
Run:
dotnet new console -o myapp
Replace myapp with your app name.
Go to Visual Studio Code, and open the folder you just created (example: myapp)
Open the program.cs file, this is your main code.
Upvotes: 0
Reputation: 11
to build your own Console Application with .NET Core folow this path:
That's it! Your console application project is ready to be edited! To see it runnin tap "dotnet run"!!!
You can debug your code in "Debug" painel (select it at the left side bar menu).
I hope it was helpfull.
Upvotes: 1
Reputation: 470
The answer is No
First things first - VS 2013 and VS code are 2 different IDEs .
Visual Studio Code - is a source code editor developed by Microsoft for Windows, Linux and OS X. It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, snippets, and code refactoring.
You cannot open VS 2013 projects in VS code.
I would suggest -See some tutorial on using VS Code IDE. here's the link Getting Started
Also here's the link for the question asked Console application using C#
Hope this helps
Upvotes: 5
Reputation: 97
Try This
using System;
namespace HelloWorld
{
class Hello
{
static void Main()
{
Console.WriteLine("Hello World!");
// Keep the console window open in debug mode.
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
}
Upvotes: 0
Reputation: 8273
The Answer is NO
VS Code does not support debugging applications running on the Desktop .NET Framework.
VS Code is optimized for cross-platform .NET Core development Due to this focus, many standard C# project types are not recognized by VS Code.
A non-supported project type is an
VS Code supports debugging of C# applications running on either .NET Core or Mono
VS Code only supports a limited set of project types (primarily .NET Core). For full .NET project support, use Visual studio community
Upvotes: 7