Embedded app.config

Posted on 2009-12-28
Last Modified: 2013-12-17
hi,i want to  store a simple value  to  appconfig file of my c# app and be able to update the value some times, i want to store the appconfig file  in the exe ,not in exe  file directory,or any other path.
so  if i embedded the appconfig file in  my app resources how can i use it  as appconfig file and upadate it by code ?
thx for ur time
Question by:shabrandi
    LVL 9

    Accepted Solution

    I am afraid you can't. Actually when your program is running, I don't think any program can modify the exe file (for editing the resource).
    LVL 9

    Expert Comment

    You can use registry instead, unless you want to move the app to other machine and the configuration is still working.
    LVL 11

    Assisted Solution

    magicdlf is right, you won't be able to achieve this.
    Why do you want to have your app.config inside your .exe by the way? If it's to prevent a user from editing your app.config values then you can use a local encrypted config file for instance or windows registry like magicdlf recommended.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now