Understanding the Core Reference in ASP.Net Web Application

Introduction

In this article, I am describing the availability of core references for the ASP.NET Web Application in Visual Studio 2013. As you know, there are many types of project templates available to create web applications in Visual Studio 2013, therefore you can add the core references for the web application if the web application is created by an Empty Project Template.

In that context, there are various types of core references available and we can choose them depending upon what type of core reference is needed.

So, let's use the example to understand the situation.

Adding the Core Reference

Let's see an example of adding the Web API core reference using the following procedure.

Step 1: Open Visual Studio 2013

Visual Studio 2013

Step 2: Create a New Project and select the ASP.NET Web Application

Create New Web Application

Step 3: You can select any Project Template. I am selecting the MVC Project Template.

MVC Project Template

Step 4: As you can see, the MVC Checkbox is selected already.

MVC Core Reference

There are various project templates available to create the web application. If you select an Empty Project template then no checkbox is checked, because it is an Empty template. In the preceding screenshots, the MVC template is selected so it is obvious that the MVC checkbox is to be checked.

Step 5: Select the Web API to add the Web API core reference to the current project.

Adding Web API Core Reference

Visual Studio automatically creates the MVC Web Application. The Web API core references have been added to the web application.

Examine the Web API Core Reference

The Web API core reference is added to the project. We use the following procedure to examine the reference:

Step 1: Go to your Solution Explorer.

Solution Explorer

Step 2: Open the Packages.config file as in the following:

Package Config File

It is the MVC Web Application so there are various core references available. We can see the Web API references in the Packages.config file.

Step 3: Open the Glabal.asax.cs file  to see the configuration of Web API reference to the application.

Global File

We can see that the Web API is registered already in the Glabal.asax.cs file.

Summary

So this article will help you to understand the core reference availability for the ASP.NET Web Application. The addition of core reference also adds the NuGet Packages (that are required) and configure the core reference for the application. The core reference will work the same for all the other project templates, like Empty, Web Forms, Facebook and so on. Thanks for reading.


Similar Articles