.NET Core tutorials – Hello world with .NET Core


To check if dotnet is correctly installed in your system, please, run command line prompt and type:

dotnet -help

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.

Now:

dotnet new webApp -o myWebApp --no-https
cd myWebApp

dotnet new creates a new application.

  • webApp parameter selects dotnet application type template.
  • -o parameter creates a directory named myWebApp  for the app.
  • --no-https specifies not to enable HTTPS.

In the myWebApp directory you have a simple web application that is ready to run.

  • Startup.cs contains all the settings and configurations.
  • The myWebApp/Pages directory contains some example web pages for the application.
  • myWebApp.csproj defines what libraries are referenced etc.

Now, your app is ready to run, so, please run this command inside app directory:

dotnet run

Once command complete navigate to:

http://localhost:5000

To change page content, open index.cshtml on Pages directory with any text editor y copy this code:

@page
@model IndexModel
@{
ViewData["Title"] = "This is the index page";
}
Hello, world! this is my first dotnet core web app!

Save the file and reload the page.

GOTO next step “.NET Core Tutorials – Razor Pages – Creating a web project”

GOTO topic index

This content is property of Matias Creimerman.
Any misuse of this material will be punishable.
Creative Commons License
This work is licensed under a
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

About the author:

Matías Creimerman
Matías Creimerman

Profesional Website

Linkedin

Blog

Medium

Youracclaim Badges

Microsoft Tech Profile

Aboutme

Connection

Portfoliobox

Github

ASP.NET Forum

Facebook

Twitter

Youtube

Crunchbase

Matías Creimerman Certifications

Matias Creimerman

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google photo

Estás comentando usando tu cuenta de Google. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s