Understanding ASP.NET Core 3.1 Bundling and Minification – Windows ASP.NET Core Hosting 2024 | Review and Comparison

The following is simple tutorial about bundling and minification in Asp.net Core MVC 3.1. This feature is important to rendering speed of your web application.

Let’s get started!

Step 1

In your Visual Studio 2017 or 2019 click on extensions then click on manage extensions. Another window wizard will pop up.

Step 2

Now click on the right side of the window wizard. In search type bundler & minified, click on download and install. It will ask you to close Visual Studio then it will start installing.  After that it will ask you to modify —  just click on modify and then you are done.

Step 3

Now start your Visual Studio and open your project. Click on wwwroot folder, select the CSS file you want to be minified, then right-click and choose bundler & minified. Then from the popup minify file. It will be the same file name with the minified version. Also, generate a bundleconfig.json file in your project.

[  
  {  
    "outputFileName": "wwwroot/css/style.min.css",  
    "inputFiles": [  
      "wwwroot/css/style.css"  
    ]  
  }  
]  

The bundleconfig.json file is a standard JSON file and very easy to understand. In this file, each bundle is named with the “outputFileName” field and the “inputFiles” to be bundled into that output are simply an array of files. There is only one file in each array here. The bundleconfig.json file also has options to control the minifying process including the option to rename locals for JavaScript files and whether to create a SourceMap file for the JavaScript file.

If instead of right-clicking a CSS or JS file, you right-click the bundleconfig.json file then you get additional options including easy access to the ‘Task Runner Explorer’ and an option to ‘Enable bundle on the build.

If you click the ‘Enable bundle on build’ context menu item then Visual Studio will download an additional NuGet package, if it is not already installed.

Try Newest ASP.NET Core 3.1 on Hosting Server

Few hosting providers support Asp.net core 3.1. We have summarized hosting provider that support latest Asp.net Core 3.1 that you can try!

1. ASPHostPortal – Top Choice Based on ASP.NET Users Experience

Start with ASPHostPortal. ASPHostPortal has been in ASP.NET hosting business for more than a decade, this provider really specialized in ASP.NET product. This company offer different ASP.NET hosting packages with at very affordable price.

Host Intro which is starter package. If you are newbie and want to test to deploy your ASP.NET Core 3, you are very welcome to register this hosting plan. This plan priced at only $1.00/month. It comes with 1 hosted domain, 1 GB disk space, 10 GB bandwith with no MSSQL and MySQL database. If you only want to host simple ASP.NET Core 3 website, this is very good option.

ASPHostPortal ASP.NET Hosting

2. HostForLIFEASP.NET – Rich Features ASP.NET Core 3 Hosting

HostForLIFEASP.NET is Microsoft Gold Partner in Europe, which means they are the first provider that support latest Microsoft products. Anytime Microsoft release new product, HostForLIFEASP.NET will automatically support it within few days. For example this newest ASP.NET Core 3 product. The engineers from HostForLIFEASP.NET fully understand the needs of ASP.NET developers.

Hostforlife ASP.NET hosting plan

Price that starts from €3.49/month is good option. It has come with latest ASP.NET Core version with 2 MSSQL databases and 5 MySQL databases. This is good option to start.

3. GearHost – ASP.NET Core Hosting for Cloud Solution

Founded in 2000, it is a fast growing web hosting company operated in Denver, US, offering the comprehensive web hosting solutions on Cloud Windows Hosting. Most of developers use their service for cloud hosting. They have more than 10 years experience in this hosting world. For cloud ASP.NET Core hosting solution, then you can trust them.