0

So i've been trying desperately to allow my SharePoint project to write an xml file to a temporary location in my project directory, but haven't had any success.

when I try:

myDataTable.WriteXml("path to folder in project", true);

i'm met with:

"Access to path is Denied"

Now I have had this issue before and have solved it by giving the user group for the application pool write permissions, but it hasn't worked for my sharepoint project. Any suggestions?

Community
  • 1
  • 1
KidBatman
  • 585
  • 1
  • 13
  • 27

1 Answers1

2

You will probably need to elevate privileges in code before calling this method. Look at spsecurity.runwithelevatedprivileges method to run code as the Sharepoint web apps application pool account. You will then need to give that account the correct permission on the file system.

Brian Hadaway
  • 1,875
  • 14
  • 23
David
  • 36
  • 1