Whenever you add a file or folder in your file system (inside the ASP.NET Core project folder), the changes will automatically be reflected in your application.
We bundle our static files into one file because for each static file, a browser will make a separate request to the server to retrieve it. If you have 100 CSS and JavaScript files, this means there will be 100 separate requests to retrieve those files. Obviously, reducing the number of requests will certainly improve the performance of your application. Thus, bundling is effectively decreasing the number of requests.
HTTP/2 uses only 1 persistent connection for all files and requests. Thus, bundling is less useful in HTTP/2. However, it's still recommended since HTTP/1.x is here to stay for a long time.
The development and deployment of an ASP.NET Core application on a Linux machine will be explained in a later chapter.
The development and deployment of an ASP.NET Core application on a Linux machine will be explained in a later chapter.
These are the important folders and files in a file-based project:
Folder/File | Description |
Controllers | This folder contains all of your controller files. Controllers are responsible for handling requests, communicating models, and generating the views. |
Models | All of your classes representing domain data will be present in this folder. |
Views | These are files that contain your frontend components and are presented to the end users of the application. This folder contains all of your RazorView files. |
wwwroot | This folder acts as a root folder and it is the ideal container to place all of your static files, such as CSS and JavaScript files. All the files which are placed in the wwwroot folder can be directly accessed from the path, without going through the controller. |
Other files | The appsettings.json file is the configuration file where you can configure application-level settings. Previously, .xml files were used for configuration; however, the .json format is less verbose, and Bower and npm (Node Package Manager) are client-side technologies, supported by ASP.NET Core applications. The Bundle.config file allows us to configure how to bundle our CSS and JS files into one file. |
Here's the project structure of ASP.NET Core:
![](assets/c7730e42-3a0a-453f-b492-37b959a795e9.png)
Despite the fact that current ASP.NET Core templates are using Bower, Bower itself is obsolete now. Instead, npm or yarn is recommended. Just like NuGet, the JavaScript world needed package managers as there are hundreds of thousands of libraries and they have complex dependencies on each other. These package managers allow you to automate the installation and upgrades of these libraries by writing single commands from the command line.