What is App.config in C#.NET? How to use it?

At its simplest, the app.config is an XML file with many predefined configuration sections available and support for custom configuration sections. A “configuration section” is a snippet of XML with a schema meant to store some type of information. Overview (MSDN) Connection String Configuration (MSDN) Settings can be configured using built-in configuration sections such as … Read more

What does ‘useLegacyV2RuntimeActivationPolicy’ do in the .NET 4 config?

After a bit of time (and more searching), I found this blog entry by Jomo Fisher. One of the recent problems we’ve seen is that, because of the support for side-by-side runtimes, .NET 4.0 has changed the way that it binds to older mixed-mode assemblies. These assemblies are, for example, those that are compiled from … Read more

How to read AppSettings values from a .json file in ASP.NET Core

This has had a few twists and turns. I’ve modified this answer to be up to date with ASP.NET Core 2.0 (as of 26/02/2018). This is mostly taken from the official documentation: To work with settings in your ASP.NET application, it is recommended that you only instantiate a Configuration in your application’s Startup class. Then, … Read more

App.Config Transformation for projects which are not Web Projects in Visual Studio?

I tried several solutions and here is the simplest I personally found. Dan pointed out in the comments that the original post belongs to Oleg Sych—thanks, Oleg! Here are the instructions: 1. Add an XML file for each configuration to the project. Typically you will have Debug and Release configurations so name your files App.Debug.config … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)