How to accept User changes in app.config file after installing the setup file?
<p>I have created one c# windows application setup.Then installed in user system.<br>
I want to accept changes from app.config file that is my user change image folder location. First time my exe file accepting changes where I have modified in appsettings. </p>

<p>The problem is it does not accept user changes in app.config file. Why does this happen? What is wrong in my setup creation?
Please verify this code and give a suitable examples for this.</p>

<p>Here is my code</p>

<pre><code>     &lt;appsettings&gt;
          &lt;add key="SQLCN" value="Data Source=localhost;Initial    Catalog=MyDB;Integrated Security=True" /&gt;
     &lt;add key="IMGFOLDER" value="D:\\ImageFolder" /&gt;
     &lt;/appsettings&gt; 

     private void SaveToIsolatedStorage(XDocument document, string file)
     {
         // Open the stream from IsolatedStorage.
         IsolatedStorageFileStream stream = new IsolatedStorageFileStream(file, FileMode.Create, GetUserStore());
         using (stream)
         {
             using (StreamWriter writer = new StreamWriter(stream))
             {
                 document.Save(writer);
             }
         }
     }

     fldr = ConfigurationSettings.AppSettings["IMGFOLDER"];

     Formload()
     {
         NewImageFolderCreation();
         PopulateTreeview();
     }

     btnImagesave()
     {
         SaveImageAfterConvertion();
     }

     private void NewImageFolderCreation()
     {
         if (!System.IO.Directory.Exists(fldr))
         {
             System.IO.Directory.CreateDirectory(fldr);
             MessageBox.Show("folder created");
         }
         else
         {
             MessageBox.Show("ImageFolder is available populate images into   folder");
         }
     }  

     private void POpulateTreeview()
     {
         DirectoryInfo info = new DirectoryInfo(fldr);
         TreeNode root = new TreeNode(info.Name);
         root.Text = "";

         //eng = OcrEngineManager.CreateEngine(OcrEngineType.Professional, false);   
         //eng.Startup(null, null, null, null);

         TreeNode node = new TreeNode();
         TrvImageFile.Nodes.Add(root);
         FileInfo[] subfileinfo = info.GetFiles("*.*");

         if (subfileinfo.Length &gt; 0)
         {
             for ( j = 0; j &lt; subfileinfo.Length; j++)
             {
                 root.Nodes.Add(subfileinfo[j].Name);
             }
         }

         TrvImageFile.ExpandAll();
     }

     SaveImageAfterConvertion()
     {
         if (!System.IO.Directory.Exists(fldr))
         {
             System.IO.Directory.CreateDirectory(fldr);

             doc.Save(ConfigurationSettings.AppSettings ["SaveImagefolderPath"] + "\\" + Newtxtfilename + ".txt", 
                 Leadtools.Forms.DocumentWriters.DocumentFormat.Text, null);

             MessageBox.Show("folder created and image output saved");
         }
         else
         {
             doc.Save(ConfigurationSettings.AppSettings["SaveImagefolderPath"] + "\\"  +Newtxtfilename + ".txt", 
                 Leadtools.Forms.DocumentWriters.DocumentFormat.Text, null);

             MessageBox.Show("ImageFolder is available  images are  Saved into folder Now");
         }    
     }
</code></pre>
