Accessing AppSettings in Console Apps Including Secrets.json

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

I was literally looking into this last week. Another bookmark.

AldoInza
Автор

As always, super useful! Thank you for what you do! I have been looking and I am not sure if you have done this already, but please consider doing a video on Source Control. Specifically within VS and explaining how to do the more advanced stuff such as cherry picking, rebasing, and stashing. It has always been so confusing for me within VS.

demariners
Автор

Thank you Master, this is a great improvement for our console applications

andergarcia
Автор

rly love your videos. In addition to this content. I start to use these settings to store my configuration, but there is a big issue that you may sshow/say to others as well. It's readonly. So for my WinForms- Practice-Program, not so useful. But i found a very useful hint on stackoverflow. Just as you show before, it's possible to add mutliple-files to the configuration during the build. So i just add a second "appsettings.json"-file to the configuration, like this
"configuration.AddJsonFile(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), ProductName, "appsettings.json"), optional: true, reloadOnChange: true);"

Then i designed a settings-class for serilisation. Stored the changed values there and save the file at the end. And with a new start, the configuration-builder merged the 2 settings-files and i can use the normal configuraion-handling. So maybe someone else, find this helpful.

michi
Автор

We use this all the time. But you have to be sure that your whole team understands it and does it the same way.

tabhorian
Автор

How is this more efficient than creating an xml config and just parsing it? Is it wrong to implement a ConfigParser helper class to read the input values of an .xml file? The user secrets part was very useful however

damianjankov
Автор

Thank you Tim. Could you also explain how to use this appsettings.json file to configure a new ILogger in that console application?

kidservice
Автор

Just starting this . Hope this works with forms app as well?

I_OptimusPrime
Автор

Hi Tim, are you going to do a follow up to this video?
One that explains where you should store the password if you create a win application (not web) and then want to connect correctly to an (Azure) SQL database:
1.Using SQL authentication. (I find this difficult because the db key or the encryption key are obviously not allowed to be stored in/with the app... but if you store it in, for example, the Azure key vault, how does the authentication take place? Where does that 'key' come from?)
2.Using Window authentication
3. Using the Azure key vault
4. Without using the Azure key vault (alternative solutions)
It would personally help me a lot if there was a follow-up because the most recent YouTube content about this is all about web apps.
And even if that follow-up does not happen, thank you for all your work!

rolphkeune
Автор

Been working on a rework for machine event software and have been planning how to move it to C# as a service. It has settings that it needs to use to verify certain conditions exist with specific machines and valves.

OldGuyAdventure
Автор

Hi Tim,
Thank you for the Video.
You didn't mentioned in your video what will happen when the code will be pushed to PROD. How the secretes will be accessed? from Production.apsettings.json, which is revealing the secrets? Should this be elaborated? I believe the code which reads from some "secret" vault should be added.

alexlo
Автор

What we need to deploy the app? Where those json files will be created/copied? Great video but this is not clear

liber_channel
Автор

great video, i just have a question, when you working in a team and each developer use the secret file, does this mean that each developer secret file guid will be added to the project? how to maintain those guids? lets say you have 10 developers and maybe some people left the company, do you have to delete the guids for the developers that left from project file?

PGWalkthrough
Автор

I wish this video was released last week 😂

sirrexos
Автор

Is this possible to deploy to virtual machines and still get access to secret? Or is it just for local development?

PekDraine
Автор

Is there a way to "Alter" the settings as well as read them in code?

demariners
Автор

What happened to the postman clone series? I believe there hasn’t been an update in a long while.

valhallagalex
Автор

So much work and packages for reading a json file, ridiculous.

rogerr
Автор

Is it just me or is Microsoft constantly trying to reinvent the wheel?

WLYT
Автор

As always, Great course!
Thank you Tim!
I cannot access source code :(
Error.
An error occurred while processing your request.
Request ID:

jesusdelarua