0

I'm having a problem writing to text file using StreamWriter. I've tested the code in asp.net mvc project and it works while developing in visual studio. The problem is when I publish my project to the server.

I've tried all the diferent solutions across the internet but nothing has really helped. I've tried adding all the diferent users through security tab and gave them full permission but still nothing.

tshepang
  • 12,111
  • 21
  • 91
  • 136

1 Answers1

0

You need to give the user who executes the AppPool in your IIS persmission to write to the folder you want the file to be written. If you are running a Windows 2008 or newer server with default IIS configuration then your AppPool will run under AppPoolIdentity. Here is a discussion on StackOverflow on how to grant AppPoolIdentity access to filesystem.

Community
  • 1
  • 1
juhan_h
  • 3,965
  • 4
  • 29
  • 35