- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Explain how to create a new ASP.NET Core project
Before you begin with ASP.NET Core, you need to install the .NET software development kit (SDK) using the following link.
To check if everything is installed correctly, open a new terminal window and run the following command:
$ dotnet --version
If the installation was successful, the program should report its version, e.g. 5.0.100.
Create Your App
Now that you have installed the framework, you can create a new ASP.NET application. NET comes with several pre-configured generators designed to make the developer’s life easier by creating everything necessary to start working on a project.
To see all the available generators, run the dotnet new command in a terminal. You should see the following output.
This tutorial focuses on using ASP.NET to build a web application that uses the Model-View-Controller (MVC) pattern, which we will learn about later in a future post. We will use the MVC generator to scaffold a complete web application using the following command.
$ dotnet new mvc -o blog
This creates an ASP.NET MVC application called blog in a blog directory. The -o parameter creates a directory named blog where your app is stored. You can see all the command-line options that the dotnet new command has by running
$ dotnet new --help
After your application is scaffolded, switch to the directory.
$ cd blog
This directory contains the files and folders that make up a complete ASP.NET application.
Run Your Application
Let’s get something up and running on the browser. In the terminal, run the dotnet run command, which first restores all the dependencies, builds the project and finally runs the application.
To see your application in action, open a new browser window and go to https://localhost:5001. You should see the default ASP.NET welcome page.
- Related Articles
- How to use ViewBag in ASP .Net MVC C#?
- How to Create/Start a new Project in Android Studio
- How to determine if C# .NET Core is installed?
- What is ViewData in ASP .Net MVC C#?
- What is the significance of NonActionAttribute in ASP .Net MVC C#?
- What is the use of ChildActionOnly attribute in ASP .Net MVC C#?
- How can we provide an alias name for an action method in Asp .Net MVC C#?
- Explain how logging works in ASP.NET Core
- How to create a new Canva account?
- Explain how reflection works in .NET framework
- Explain how Razor Pages work in ASP.NET Core
- Explain how error handling works in ASP.NET Core
- How to create a directory in project folder using Java?
- How to create a new database in MongoDB?
- How to create a new collection in MongoDB?
