⏰ Only 3 days leftto get 80% off all UDEMY courses →

Run .NET App in VSCode

Hanii

Hanii ––– views

· 3 min read
main pic

Why vscode instead of visual studio?

There are several reasons why you might choose to use Visual Studio Code (VS Code) instead of Visual Studio for developing and debugging .NET applications:

  • Lightweight and fast: VS Code is a lightweight code editor that is optimized for speed. It starts up quickly and is generally faster than Visual Studio, especially when working with large solutions.
  • Cross-platform: VS Code is available for Windows, Linux, and macOS, making it a great option for developers who work on multiple platforms. Visual Studio, on the other hand, is only available for Windows.
  • Free: VS Code is a free and open-source code editor, whereas Visual Studio is a paid product. This can be a significant factor for developers working on a budget or who do not need the advanced features of Visual Studio.
  • Customizable: VS Code has a large and active community of developers who have created a wide range of extensions and plugins that can be easily installed and configured to customize the editor to your specific needs.
  • Integrated terminal: VS Code has an integrated terminal that allows you to easily run command-line tools and scripts, such as dotnet, npm, and, git without leaving the editor.

Of course, Visual Studio has its own set of advantages, such as a rich set of tools and features for developing and debugging .NET applications, and support for a wider range of programming languages.

Prerequisites

To run a .NET application in Visual Studio Code (VS Code), you need to have the following installed on your system:

  • VS Code: You can download and install the latest version of VS Code from the official Website.
  • .NET SDK: You need to have the .NET SDK (Software Development Kit) installed on your system to build and run .NET applications. You can download and install the latest version of the .NET SDK from the official website.
That's it! These are the only prerequisites you need to run a .NET application in VS Code.

Windows .NET Forms application using CMD

To create a .NET Windows Forms application using the Command Prompt (cmd), follow these steps:

Make sure you have the .NET SDK installed on your system.

Open the Command Prompt and navigate to the directory where you want to create your project

or

run the following command to make a project folder📂

  • Run the following command to create a new .NET Windows Forms application:
    • dotnet new winforms

  • Type the following command to restore the required NuGet packages:
    • dotnet restore
  • Type the following command to build the application:
    • dotnet build
  • Once the build is successful, type the following command to run the application:
    • dotnet run

This will start the application and you should see the Windows Forms window.

Happy Coding!😊

Hanii

About Hanii

I'm hanii a creative coder, blogger, and self-proclaimed develope.


Copyright © 2024 nothanii. All rights reserved.