Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of app.config file in ASP.NET Core web application (.NET Framework)?

In ASP.NET Core web application (.NET Framework) there is app.config file which contains:

<configuration>
   <runtime>
      <gcServer enabled="true"/>
   </runtime>
</configuration>

but this file is not available in ASP.NET Core web application (.NET Core) project. running GC in server mode is necessary for ASP.NET Core web application (.NET Framework) ?

like image 552
Mohsen Esmailpour Avatar asked May 26 '16 11:05

Mohsen Esmailpour


People also ask

What is the purpose of app config?

App. Config is an XML file that is used as a configuration file for your application. In other words, you store inside it any setting that you may want to change without having to change code (and recompiling). It is often used to store connection strings.

What is config file in .NET Core?

Application configuration in ASP.NET Core is performed using one or more configuration providers. Configuration providers read configuration data from key-value pairs using a variety of configuration sources: Settings files, such as appsettings. json.

What is Web config file in ASP.NET and its use?

The web. config is a file that is read by IIS and the ASP.NET Core Module to configure an app hosted with IIS.

What is the configuration file for ASP NET MVC core app?

ASP.NET MVC configuration In ASP.NET apps, configuration uses the built-in . NET configuration files, web. config in the app folder and machine. config on the server.


1 Answers

There is an equivalent in the web app, you're looking for project.json and it's runtimeOptions. I detailed this a little in my migration guide, (look for runtimeOptions).

The addition of the gsServer is to tell the runtime to perform garbage collection. The server in the context of the ASP.NET Core application is Kestrel. There are various details about this in the project.json schema changes here. The documentation states this:

Enable server GC

Additionally, you should look at the following:

  • Host Configuration Knobs
  • Rutime Configuration
like image 135
David Pine Avatar answered Oct 12 '22 11:10

David Pine