To check if dotnet is correctly installed in your system, please, run command line prompt and type:
and press enter.
If the command runs, you see a dotnet command options. In case the command fails, download dotnet core sdk or install Visual Studio 2019 with dotnet core framework.
dotnet new webApp -o myWebApp --no-https cd myWebApp
dotnet new creates a new application.
webAppparameter selects dotnet application type template.
-oparameter creates a directory named
myWebAppfor the app.
--no-httpsspecifies not to enable HTTPS.
myWebApp directory you have a simple web application that is ready to run.
Startup.cscontains all the settings and configurations.
myWebApp/Pagesdirectory contains some example web pages for the application.
myWebApp.csprojdefines what libraries are referenced etc.
Now, your app is ready to run, so, please run this command inside app directory:
Once command complete navigate to:
To change page content, open index.cshtml on Pages directory with any text editor y copy this code:
ViewData["Title"] = "This is the index page";
Hello, world! this is my first dotnet core web app!
Save the file and reload the page.