DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Build a Simple Chat Server With gRPC in .Net Core
  • Prototype Pattern in JavaScript
  • Build a Web Application Based on Your Excel Files
  • How To Build AI-Powered Prompt Templates Using the Salesforce Prompt Builder

Trending

  • How to Introduce a New API Quickly Using Micronaut
  • Useful System Table Queries in Relational Databases
  • Introducing Graph Concepts in Java With Eclipse JNoSQL, Part 2: Understanding Neo4j
  • Securing the Future: Best Practices for Privacy and Data Governance in LLMOps

Setting Up an MVC Core 3.1 Application With an Empty Template

A tutorial on how you can setup MVC Core 3.1 Application in visual studio 2019 from scratch and a breakdown of ASP.Net Core benefits.

By 
Farhan Ahmed user avatar
Farhan Ahmed
·
Updated Aug. 03, 20 · Tutorial
Likes (5)
Comment
Save
Tweet
Share
11.9K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

Today I will explain you, how you can setup MVC Core 3.1 Application in visual studio 2019. We will understand it from scratch.

What is ASP.Net Core?

ASP.Net core is a free and open-source management and computer framework for Windows, macOS, and LINUX operating systems. It is a cross-platform .NET framework. Using ASP.NET core we can develop a modern internet-connected application for cross-platform use.

  • Cross-platform and open source
  • Unified programming model for MVC and Web API
  • Dependency injection
  • Testability
  • Support for Cloud-Based Development.

A better understanding of ASP.Net Core MVC requires the basic knowledge below:

  • C# programming
  • ASP.Net MVC
  • Razor Programming (good to have)
  • Entity Framework
  • Identity Framework for security

Step 1

Download Visual Studio 2019 and install it. Below is the download link for Visual Studio 2019. Download the community version. Click here to download.

Step 2

Download and install core 3.1 SDK. Click here to download.

Step 3

Startup Visual Studio 2019. Choose ASP.NET Core Web Application and click on "Next"screenshot of ASP.net core web application and next button

After clicking next, another wizard will open. Under the project name, give a meaningful name to your project and click on create.

naming project

That will open up another new wizard select ASP.Net Core 3.1 from the dropdown. If not, select default. Choose an empty template and click on create which will create your first ASP.Net Core Application.choosing empty template

Step 4

Visual Studio 2019 will generate program and startup classes. Now open the startup file and configure ASP.Net MVC Core Application development. Under app.UseEndpoints method just map endpoints.MapControllerRoute.

C#
 




xxxxxxxxxx
1
11


 
1
app.UseEndpoints(endpoints =>  
2
            {  
3
                endpoints.MapControllerRoute(  
4
                    name: "default",  
5
                    pattern: "{controller=Home}/{action=Index}/{id?}");  
6
            });  
7
Now second configuration setting is under ConfigurationServices  
8
public void ConfigureServices(IServiceCollection services)  
9
        {  
10
            services.AddControllersWithViews();  
11
        } 


We are done with configuration settings in the startup file.

Step 5

Now under the project, create a folder with the name Controllers. After creating the "Controllers" folder, right-click on the "Controllers" folder and add a controller.creating controllers folder

A window will appear. Choose MVC5 Controller-Empty and click "Add".


add


After clicking on "Add", another window will appear with DefaultController. Change the name to HomeController and click "Add". The HomeController will be added under the Controllers folder. Don't change the Controller suffix for all controllers, change only the highlight, and instead of Default, just change Home.


changing home


Step 6

Right-click on Index of ActionResult choose "Add View" and click on it. Now you will get another window that has the default view name as ActionResult name. Check to use a lay page, and click on "Add".choosing lay page and add button


Step 7 

Build and Run your project, ctrl+F5.

Summary

In this article, I have explained how to set up the development environment of an ASP.Net Core MVC Application.

I hope this is helpful for beginners. I will explain the development of an ASP.Net Core MVC Application step-by-step in my upcoming articles.C

Web application ASP.NET Core Template

Published at DZone with permission of Farhan Ahmed. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Build a Simple Chat Server With gRPC in .Net Core
  • Prototype Pattern in JavaScript
  • Build a Web Application Based on Your Excel Files
  • How To Build AI-Powered Prompt Templates Using the Salesforce Prompt Builder

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!