VSCode runs C# code to create ASP.NET CORE WEB MVC and API projects

Download the .NET framework (the necessary environment to run C#)

Download link:

.NET SDKs downloads for Visual Studio (microsoft.com)

After the download and installation is complete, enter in the command line terminal: dotnet

The console feedback is as follows:

 The installation is successful!

Install these two plug-ins as shown in the figure: You can download these [C#, .NET Core Test Explorer, vscode-solution-explorer, Visual NuGet]

 

1. Create a new backend folder to store the solution directory

2. A little terminal open

 3. Enter dotnet new sln -n "Solution Name" and press Enter to confirm

4. An APP.sln file will be generated

 5. Install the plugin (see top image)

 6. Right click add new project

 7. Select the project template to be created, the blogger here selects the web api project template, and then press Enter.

 Choose the C# language

 Project name (MaintanceAPI)

 Projects are created into the solution

 ps: Friends who are familiar with commands can also use commands in the terminal to create

dotnet new "webapi" -lang "C#" -n "MaintanceAPI" -o "MaintanceAPI"

 8. Compile:

dotnet build

9: Run:

dotnet run

The following is web MVC

10: Debugging:

VSCode plus dotnet7.0 to create development, vs and vscode creation methods, the difference between command creation and extension method creation, and extension recommendations

Guess you like

Origin blog.csdn.net/qq_26695613/article/details/129735396