📅  最后修改于: 2023-12-03 15:14:47.551000             🧑  作者: Mango
.NET Core is a free and open-source, cross-platform framework used for building modern, cloud-based, internet-connected applications. It's a major version of .NET framework that is modular, lightweight, and optimized for performance.
A WebApp is simply a web application that is written in C# programming language. It can be hosted on any web server, allowing users to access it through a web browser. In a WebApp, you can create web pages, handle user input, and interact with databases, among other things.
To get started with .NET Core WebApp, you need to have the following tools installed:
To create a new .NET Core WebApp project, open a command prompt, and run the following command:
dotnet new webapp -n MyWebApp
dotnet new webapp
: This command creates a new .NET Core WebApp project.-n MyWebApp
: This command sets the name of the project to "MyWebApp".To run the project, navigate to the project folder, and run the following command:
dotnet run
This command builds and runs the project. Open your web browser and navigate to http://localhost:5000
to view your WebApp.
When you create a new .NET Core WebApp project, there are some files and folders that are generated automatically. Here's a brief description of some of the important files and folders:
Main
method of the application. It creates and configures the WebHost
and runs the application.Startup
class, which configures the application services and middleware..NET Core WebApp in C# is a powerful tool for building modern, cloud-based, internet-connected applications. With .NET Core, you can create high-performance, cross-platform web applications that run on Windows, macOS, and Linux.