Wednesday 13 January 2021

Different JSON files in ASP.net Core

 Hello Friends,  


In this article, I will explain .NET CORE JSON files

  • What are configuration JSON files in ASP.net Core?
  • Different configuration JSON files in ASP.net Core
  • Why we need configuration.json files in ASP.net Core




What are configuration JSON files in ASP.net Core?

ASP.net Core is re-architected from prior versions of ASP.net, where the configuration was relying on System.Configuration and XML configurations in web.config file. In ASP.net Core, a new easy way to declare and access the global settings for a solution, project-specific settings, client-specific settings, etc. The new configuration model works with XML, INI, and JSON files.
 

Different configuration JSON files in ASP.net Core

There are mainly 6 configuration JSON files in ASP.net Core.

  • global.json
  • launchsettings.json
  • appsettings.json
  • bundleconfig.json
  • project.json
  • bower.json

1. global.json :

You can define the solution level settings in the global.json file. If you will open the global.json file, you will see the below code:

a. Projects: projects property defines the location of source code for your solution. It specifies two locations for projects in the solution: src and test.src contains actual application and test contains any test.

 

2. launchsettings.json :

In launchsettings.json file, You can define project-specific settings associated with each profile Visual Studio is configured to launch the application, including any environment variables that should be used. You can define a framework for your project for compilation and debugging for specific profiles.

3. appsettings.json 

ASP.NET stores application configuration settings in Web. config. ASP.NET Core uses AppSettings.json to store custom application settings, DB connection strings, Logging, etc. Below is a sample of Appsettings.json


4.bundleconfig.json

You can define the configuration for bundling and minification for the project.


5. project.json:

Asp.net Core uses Project.JSON file for storing all project-level configuration settings.The Project.json file stores configuration information in JSON format.



6. bower.json :

Bower is a package manager for the web. Bower manages components that contain HTML, CSS, JavaScript, fonts or even image files. Bower installs the right versions of the packages you need and their dependencies. With ASP.NET core, jQuery and bootstrap packages are already installed and bower, gulp and NPM are already in place. Client-side packages are listed in the bower.json file.




Hope this helped you  
Happy Programming!!
Don’t forget to leave your feedback and comments below!
If you have any query mail me to Sujeet.bhujbal@gmail.com     
Happy programming!!
Don’t forget to leave your feedback and comments below!
Regards
Sujeet Bhujbal
--------------------------------------------------------------------------------
------------------------------------------------------------------------------