none
questions about application configuration file RRS feed

  • Question

  • Hi,

    I have few questions about application configuration file please:

    1. I want to place my applicatioj configuration and make it editabe through my C# application, so should I place it in the Program Files folder together with my application or in the App Data folder?
    2. If in the Program Files then how can  I overcome the security issue with updating the files for non administrator users?

    Thanks,

    Jassim

    • Changed type Jassim Rahma Friday, September 25, 2015 1:00 PM
    Thursday, September 24, 2015 9:10 PM

Answers

  • because most of the seetings in the App.Config are based on user customization and I am afraid if the Windows user is limited (not administrator) then my C# application will fail because the file is located in the Program Files.

    Hi Jassim, 

    Thanks for providing more useful information. 

    >>I want to place my application configuration and make it editable through my C# application, so should I place it in the Program Files folder together with my application or in the App Data folder?

    Based on my researchm yes, you could relocating app.config file to a custom path. 

    For more information, please refer to the following thread

    http://stackoverflow.com/questions/1838619/relocating-app-config-file-to-a-custom-path

    >>If in the Program Files then how can  I overcome the security issue with updating the files for non administrator users?

    You should run an application with an account which has the necessary permission.

    Best regards,

    Kristin 



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, September 29, 2015 2:59 PM

All replies

  • As this is a question, Please change the type of your post from General Discussion to Question.
    Thursday, September 24, 2015 9:22 PM
  • Hi Jassim,

    >>I want to place my application configuration and make it editable through my C# application, so should I place it in the Program Files folder together with my application or in the App Data folder?

    An application configuration file is an XML file used to control assembly binding. It can redirect an application from using one version of a side-by-side assembly to another version of the same assembly. When you create a project, the App.config file will place in the project folder by default. Could you tell me why you want to place application configuration.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, September 28, 2015 3:29 AM
  • because most of the seetings in the App.Config are based on user customization and I am afraid if the Windows user is limited (not administrator) then my C# application will fail because the file is located in the Program Files.
    Monday, September 28, 2015 2:27 PM
  • because most of the seetings in the App.Config are based on user customization and I am afraid if the Windows user is limited (not administrator) then my C# application will fail because the file is located in the Program Files.

    Hi Jassim, 

    Thanks for providing more useful information. 

    >>I want to place my application configuration and make it editable through my C# application, so should I place it in the Program Files folder together with my application or in the App Data folder?

    Based on my researchm yes, you could relocating app.config file to a custom path. 

    For more information, please refer to the following thread

    http://stackoverflow.com/questions/1838619/relocating-app-config-file-to-a-custom-path

    >>If in the Program Files then how can  I overcome the security issue with updating the files for non administrator users?

    You should run an application with an account which has the necessary permission.

    Best regards,

    Kristin 



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, September 29, 2015 2:59 PM
  • so basically if I want the App.Config file to be Read/Write then I should move it our from the Program Files if the user doesn't have necessary permissions?
    Thursday, October 1, 2015 2:12 PM
  • so basically if I want the App.Config file to be Read/Write then I should move it our from the Program Files if the user doesn't have necessary permissions?

    @Jassim,

    You don't need to do that.

    My suggestion is that you can run the application with an account which has the permission to modify the config file.

    Here're some methods to implement that.

    http://www.codeproject.com/Articles/4051/Windows-Impersonation-using-C

    http://www.codeproject.com/Questions/578382/RunplusaplusC-plusApplicationplusasplusspecificp

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 2, 2015 9:28 AM