MVCApplication.md - brainchildservices/curriculum GitHub Wiki

SLIDE-1

CREATING ASP.NET MVC APPLICATION(Using dotnet command line)

In this task, you will create a new ASP.NET MVC web project. The web project will be the starting point for your application, and the class library will hold your fluent model.

SLIDE-2

Prerequisite:

Command Syntax:

  • Command Usage – dotnet new mvc:
    1. “dotnet new mvc”
    2. “dotnet new mvc –o DemoMVC”

image

  Whole MVC project structure will be created in DemoMVC folder.

SLIDE-2(DOWNWARDS)

  • To build the MVC project using CLI, run the command dotnet build,

image

SLIDE-2(DOWNWARDS)

  • To run the MVC project using CLI , run the command 'dotnet run'.

image

SLIDE-2(DOWNWARDS)

  • Application will run on the browser as shown below with default port no: 5001

image

SLIDE-3

DOTNET COMMANDS FOR CREATING DEMOMVC [WHOLE CODE AND IMAGE TO FOLLOW]

  • Image to follow

    image

SLIDE-3(DOWNWARDS)

  • Code to follow

                                            F:\project>dotnet new mvc -o DemoMVC
                                            The template "ASP.NET Core Web App (Model-View-Controller)" was created successfully.
                                            This template contains technologies from parties other than Microsoft, see https://aka.ms/aspnetcore/5.0-third-party-notices for details.
                                            
                                            Processing post-creation actions...
                                            Running 'dotnet restore' on DemoMVC\DemoMVC.csproj...
                                              Determining projects to restore...
                                              Restored F:\project\DemoMVC\DemoMVC.csproj (in 127 ms).
                                            Restore succeeded.
                                            
                                            
                                            F:\project>cd DemoMVC
                                            
                                            F:\project\DemoMVC>dotnet build
                                            Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET
                                            Copyright (C) Microsoft Corporation. All rights reserved.
                                            
                                              Determining projects to restore...
                                              All projects are up-to-date for restore.
                                              DemoMVC -> F:\project\DemoMVC\bin\Debug\net5.0\DemoMVC.dll
                                              DemoMVC -> F:\project\DemoMVC\bin\Debug\net5.0\DemoMVC.Views.dll
                                            
                                            Build succeeded.
                                                0 Warning(s)
                                                0 Error(s)
                                            
                                            Time Elapsed 00:00:15.80
                                            
                                            F:\project\DemoMVC>dotnet run
                                            Building...
                                            info: Microsoft.Hosting.Lifetime[0]
                                                  Now listening on: https://localhost:5001
                                            info: Microsoft.Hosting.Lifetime[0]
                                                  Now listening on: http://localhost:5000
                                            info: Microsoft.Hosting.Lifetime[0]
                                                  Application started. Press Ctrl+C to shut down.
                                            info: Microsoft.Hosting.Lifetime[0]
                                                  Hosting environment: Development
                                            info: Microsoft.Hosting.Lifetime[0]
                                                  Content root path: F:\project\DemoMVC