Click here to Skip to main content
16,021,211 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Windows setup project . I have to write the config parametrs in "Project.exe" file while setting up the project.While opening that file from c# code ,I am getting "Access to the path c:\...\Project.exe" is denied...How to solve this permission issue?I am using this code
C#
Configuration config = ConfigurationManager.OpenExeConfiguration(filePath);           
config.AppSettings.Settings.Clear();
config.AppSettings.Settings.Add("DTD_XML_FILES_PATH", txtDTDFilesPath.Text);
if(chkLogException.Checked)
   config.AppSettings.Settings.Add("EXCEPTION_LOG_FILES_PATH", txtExceptionLogPath.Text);         
config.AppSettings.Settings.Add("DISPLAY_USER_FRIENDLY_MESSAGES", chkUserFrndMsgs.Checked.ToString());
config.Save();
Posted
Updated 9-Aug-12 20:18pm
v4

The error got fixed by writing the config details from the OnCommitted event of installer
 
Share this answer
 
make sure that file is not already open and that you have access to the appropriate folder.
 
Share this answer
 
Comments
BhuvanaRamesh 10-Aug-12 4:30am    
Thnks for your response..

The error got fixed by writing the config details from the OnCommitted event of installer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900