I’m using log4net in my wpf solution. It is writing to error.xml correctly.
I need to change the permissions on the file so that every user on a PC has permission to write to error.xml.
How do I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A more complicated way would be to ensure your application is integrated with UAC so that it requests elevated privileges when starting and then it will run with Admin rights and it will be able to write to that file. But it’s not a good practice i think.
Another way would be to write to the Application Data folder like it is explaned here:
log4net writing to file. How to open up permissions
Alternative solution: The installer will request elevated rights, create the file and give write rights to “Everyone”.