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
webAppparameter selects what template to use when creating your app. - The
-oparameter creates a directory namedmyWebAppwhere your app is stored. - The
--no-httpsflag 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.cscontains all the settings and configurations.- The
myWebApp/Pagesdirectory contains some example web pages for the application. myWebbApp.csprojdefines 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