filmov
tv
.NET Configuration Easy... Right

Показать описание
Let's face it, we've all done it at some point. You have a value in your code that you don't want to hard code as it will vary in different environments or needs to change in a runtime environment, so you want to make it configurable in a file. That's where the fun begins.
In the .NET Framework, you usually create an XML configuration file and reference it using some static methods. Or maybe you use the designer in Visual Studio to do the work for you? In .NET Core, you are given a JSON file by default and access it through the IConfiguration interface. Job done ...or so you think.
· How do you code the keys to access the values?
· How do you unit test it and what if you need to test different values?
· What if you want to store values other than primitive types?
· What if you want to have secure passwords, but don't want them in your source control?
· What if you don't want to use json files ... or come to that, don't want to use files at all?
· What if you want to change values in a Docker container
.. and the questions go on and on.
In this talk, we start with a brief overview of the history of configuration in .NET Framework and how Microsoft handed developers a loaded gun to shoot themselves in the foot. Moving on to .NET Core, things are much better, but there are still some gotchas.
Lastly, the talk goes on to deal with the questions raised above with a "SOLID" based approach that makes configuration not only fully testable, but adds enhancements to handle encrypted configuration values (because you're not storing passwords as clear text in source control are you?) and validation of the configuration data before it hits your code.
-About the Speaker
Steve Collins is an independent software developer/architect with over 25 years’ experience in the industry working with Microsoft technologies.
Steve first started programming on the ZX Spectrum and released his first open source project in 1989 … well kinda … he had a program printed in Your Sinclair magazine (with his name spelt wrong).
-
Links
-
Sponsors
-
The Video
-
dotnetsheff
dotnetsheff is a monthly user group focused on software development, particularly in the .NET ecosystem. We welcome people with interests in software development of all ages and levels of experience
In the .NET Framework, you usually create an XML configuration file and reference it using some static methods. Or maybe you use the designer in Visual Studio to do the work for you? In .NET Core, you are given a JSON file by default and access it through the IConfiguration interface. Job done ...or so you think.
· How do you code the keys to access the values?
· How do you unit test it and what if you need to test different values?
· What if you want to store values other than primitive types?
· What if you want to have secure passwords, but don't want them in your source control?
· What if you don't want to use json files ... or come to that, don't want to use files at all?
· What if you want to change values in a Docker container
.. and the questions go on and on.
In this talk, we start with a brief overview of the history of configuration in .NET Framework and how Microsoft handed developers a loaded gun to shoot themselves in the foot. Moving on to .NET Core, things are much better, but there are still some gotchas.
Lastly, the talk goes on to deal with the questions raised above with a "SOLID" based approach that makes configuration not only fully testable, but adds enhancements to handle encrypted configuration values (because you're not storing passwords as clear text in source control are you?) and validation of the configuration data before it hits your code.
-About the Speaker
Steve Collins is an independent software developer/architect with over 25 years’ experience in the industry working with Microsoft technologies.
Steve first started programming on the ZX Spectrum and released his first open source project in 1989 … well kinda … he had a program printed in Your Sinclair magazine (with his name spelt wrong).
-
Links
-
Sponsors
-
The Video
-
dotnetsheff
dotnetsheff is a monthly user group focused on software development, particularly in the .NET ecosystem. We welcome people with interests in software development of all ages and levels of experience