Create your app
In your command prompt, run the following commands:
dotnet new webApp -o myWebApp --no-https
cd myWebApp
What do these commands mean?
The
dotnet new
command creates a new application.- The
webApp
parameter selects what template to use when creating your app. - The
-o
parameter creates a directory namedmyWebApp
where your app is stored. - The
--no-https
flag specifies not to enable HTTPS.
The
cd myWebApp
command puts you into the newly created app directory.What files were created?
Several files were created in the
myWebApp
directory, to give you 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. myWebbApp.csproj
defines what libraries are referenced etc.
Run your app
In your command prompt, run the following command:
dotnet run
Once the command completes, browse to
http://localhost:5000
Congratulations, you've built and run your first .NET web app!
https://dotnet.microsoft.com/learn/web/aspnet-hello-world-tutorial/intro
No hay comentarios:
Publicar un comentario