kims9
kims9

Reputation: 45

Where is my C# console application 'app.config' file

Why there is no app.config file in my c# console application by default. I have been watching many tutorials on entityframework, and in all of them, there is app.config by default. Why i dont have it in my console app? enter image description here I need that file so i can add configure string to it

Upvotes: 1

Views: 6140

Answers (1)

Fandango68
Fandango68

Reputation: 4838

The newer .NET Cores (5 & 6) no longer use a app.config file.

You should use an appsettings.json file.

From the Microsoft docs:

All of the application's settings are contained in a file named appsettings.json. Any changes to the appsettings.json file will require restarting the "Microsoft IIS Administration" service to take effect.

The appsettings.json file is located at: %SystemDrive%\Program Files\IIS Administration<version>\Microsoft.IIS.Administration\config\appsettings.json

But not just for web apps, but any Console app also follows the same config methodology. The above link has examples to cover most cases.

Upvotes: 1

Related Questions