Manoj
Posts: 1
Joined: Mon Apr 29, 2024 8:14 pm

How to replace values in appsettings.json file?

During the installation process, I want to get user input (from the dialog I will create) and replace the values in my appsettings.json file with the user input. I have made a simple edit box and gave it the Property name: AUTHENTEK_URL. when the user enters a value in the box I want that value saved in my JSON file. for the value in the JSON file, I put it as: ["AUTHENTEK_URL_PLACEHOLDER"]. Is it best to approach it through a text file update or a custom action? I would love some help on this, thanks!
Liviu
Posts: 1077
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: How to replace values in appsettings.json file?

Hello Manoj and welcome to our forums,

I have replied to your email.

You can check our video tutorial:

https://www.youtube.com/watch?v=QK_LLkG6n7c

You can also find a sample project on the below forum thread:

viewtopic.php?t=49288

Hope this helps!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”