Note that there are some explanatory texts on larger screens.

plurals
  1. POc# App config settings windows 8 - access to tmp file denied
    primarykey
    data
    text
    <p>This question was originally posted as "Error occurred loading a configuration file: Access to path c:\Program Files (x86)\… denied", but I didn't have much success finding a solution.</p> <p>My application was written on Windows 7, it's a 32-bit application written with Visual Studio 2010. When I try to deploy this application on a Windows 8 system, the app fails during form_Load, with an error about access to a tmp file in the EXE's directory. I am not creating this temp file directly, but it has a name which is consistent with one generated by the C# GetTempFileName method. The name of the EXE config file (MyApp.exe.config) is also referenced in the error message. </p> <p>I use the ConfigurationManager to store all of my application settings at startup, so I'm guessing that it is somehow related to this. If I build the application on a Windows 8 system it runs fine on the Windows 8 system, but generates the same error if deployed on a Windows 7 system. I don't know yet exactly what line of code is causing the error but the calls boil down to</p> <pre><code>System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings.Add(settingName, settingValue); config.Save(); ConfigurationManager.RefreshSection("appSettings"); </code></pre> <p>Both the Windows 7 and 8 systems are 64-bit but the application is 32-bit. Thanks in advance for any advice in solving this. </p> <p>I use the Settings class to handle the configuration data and the TEMP variable is what I expect it to be, my user\AppSettings\Local\Temp. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload