(#3) Create ASP.Net Core Web API project using CLI and VS Code | ASP.Net Core Web API Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to course spider in this video we are going to discuss how to create an asp.net core obp project using command line and visual studio code let's understand what is command line or cli in dot net core the dot net command line interface is a cross platform command line tool used for developing and performing the various development activities when developing dot net core applications that means as you know that the dot net core application is cross platform support so that you can create and develop the dot net core application using command line using visual studio or using any editor you can choose any editor and you can do the development of network but you need to install the.net core sdk first to install the netcode sdk you may go through the microsoft document site so let's create a project of asp.net core web api using command line to create a project using command line in the run tab type as cmd open as run as administrator to work on.net core we must need the dot net core sdk in my system i have already installed the dot net core sdk to check that here you need to type which dot net then hit enter you can see that the dot net is found in my system and also some dot net other command is so here let's see what the sdks is installed in my system so let's type here dot net list of sdks you can see that there is four type of sdk is found in my system one is two point one two point two three point one and the three point one point four double zero is the latest version also to check all the command we need to type here dotnet then help you can see that whenever i type in the dotnet help then then all the dot net code support command is so here so let's focus how to create a sd.net core oebi project using command line suppose in this location i want to create my project currently i am here on the d drive and on the folder name is dotnet cli and you can see that on the command prompt currently i am on c drive windows system32 to move the d drive you just type your d drive then we need to jump to dot net cli folder so need to type as cd dot net cli so let's see how to create asp.net obp across it using command line to create a obp project using command line we need to type as dotnet the new web api then let's the project name is my obpa code here we type as dot net new web api then my oeb code that means dotnet is denoted dot net code command and new because we want to create a project as new then web api that means it create the project of web api project then our project name is my obpa code and hit enter now you can see a project is created in this location to jump this path we need to type your h cd then the project name is my webvi core then let's check first this project is build or not so to build this project using command line so you need to type as dotnet build you can see that now the build is succeeded then finally we need to run this project to run the project we need to type as dotnet run you can see that now the project is running and mind that whenever the project is running on the command line argument then it should be drawn in the kestrel server if you are new to the castrol server then you please check our previous video the video is said on the description box you can find there so let's copy this path and run this application let's hit enter you can see that in the command prompt we found that the server is listening in this port number whenever i type of localhost 5001 then it clearly shows that this localhost page can't be found this is because in the properties class in the launch setting.json open with a note fair you can see that it called the castle server and in the castle server the launch url is by default is weather forecast what is weather forecast weather forecast is the controller in the controller the api controller is set and the route should be controller that means in the locales 5000 word we should type controller name so let's type your as weather forecast hit enter you can now see everything is working perfectly for now and the controller gate method result is display here so using this way you can create a project using command line argument then let's understand how to create a project using visual studio code you can see that from this link you can download follow the url code.visualstudio.com for my case i have already installed the visual studio code and in this folder we want to create our project open powershell window here and here we need to type as code dot code dot is the shortcode to open the visual studio code you can now see we are in the vs code api folder go to the view tab and select the terminal window in the terminal window you can see that we are on the vs code api so here we need to type fetch dotnet then new let's avpi because we want to create as oppi then let's my core api that's it hit enter you can see now the project has been created and let's build our project dotnet build then we need to jump the my core api folder so to do this here you need to type as cd then my core api hit enter now you can see that we are on the core ep folder let's build our project dotnet build you can see that now it build perfectly to run this application we need to type here as dotnet then run hit enter you can see that we are getting error because of unable to start the kestrel server and the error is failed to bind the address https 5001 this address already in use that means whenever i run the application using command line argument then the browser is hit and in the 5001 it's showing as already in use in the port number you can also go through the launch setting rotation and simply let's make as 52 as well as let's make as five thousand three here but i am saying that if this type of error is come then how to get rid of this so we need to type your dot net build build the project again and let's run the application with dot netron you can see that now our port is running on localhost 5002 let's copy this open the browser and in the browser window type here 5002 then we need to pass the controller name controller is weather forecast you can see this is working perfectly so using this way you can create the asp.net core obpa project using bs code that's it in the video do like and subscribe for more upcoming videos thanks for watching you
Info
Channel: Jayant Tripathy
Views: 10,623
Rating: undefined out of 5
Keywords: aspnetcoremvc, aspnetmvc, aspnetcorewebapi, webapi, vscode, visual studio code, cli, command line interface, How to create ASP.Net Core Web API project using CLI and VS Code, ASP.Net Core Web API Tutorial, create a web api with asp.net core and visual studio code, visual studio code asp.net core, asp.net core web api tutorial for beginners, how to create asp.net core web application in vs code, asp.net core web api best practices, dotnet new webapi, Jayant Tripathy
Id: UG1AdlmrJGQ
Channel Id: undefined
Length: 7min 31sec (451 seconds)
Published: Thu Oct 01 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.