Part 3 : Create Asp.Net Core project using .NET CLI
5 Minutes Of Reading
I have shown you installation of VS 2019 community version in previous blog, here we will create simple project using Asp.Net Core 3.1.
Asp.Net core application can be created using IDE (integrated development environment) like visual studio or .Net CLI (command line interface). With the help of .Net CLI you can create application on windows, Linux or Mac.
Let’s create simple example with .Net CLI and then using Visual Studio. First check the latest version of Core installed on your personal computer.
Open Developer command prompt from Visual Studio 2019 folder from start up Menu.
Check version of Core using below highlighted command, in my PC Core 3.1.402 is installed.
We’re not going to create new project inside Program Files (x86) folder, lets change targeted path in developer command prompt.
Folder is created under D drive with name CoreSamples.
Create new folder under CoreSamples with name Sample_CLI.
Create new project with same name Sample_CLI under Sample_CLI folder with the help of command prompt.
Instead of using above command to check list of projects you can also use ‘dotnet new --help’.
Project Sample_CLI.csproj gets created under Sample_CLI folder. Same can be verified in below screen.
Now build and run your application with below command highlighted.
Also, application running with dotnet run command and listening on port 5000(http) and 5001(https). Open browser and type above URL on browser to verify result/output.
Lets open project directory and check from where text Hello World! Rendered on browser window.
Do not worry will discuss in detail how text Hello World! rendered. In this article I wanted to show you with the help of .Net CLI we can create projects (web, console, …etc), build and run. For Mac and Linux also .Net CLI work means it is cross platform tool to create project, build, run and maintain and we can use IDE to maintain project or also update code using notepad. But it is recommended to use IDE for better maintenance.
In next blog I will show you creating project using visual Studio.
5 Comments:
Got Good Info.
Very informative article thanks for sharing
Great
Informative article...it will be good if you can mention the command as a text also.
Very good article for VS installation
Post a Comment
Subscribe to Post Comments [Atom]
<< Home