0

I'm having some trouble with reading and writing files on the server with my Web-Application.

I have a c#-class library for my business logic and a ASP.net Web Application as front-end. The whole application works fine when I start it from Visual Studio. When I first tried to deploy it I got an error that I don't have permission to write on c:/inetpub/wwwroot/myfolder...

Then I tried to use relative paths like /myfolder but I always get the message cannot access C:/myfolder! And I really don't know where the "C" is coming from?

Cœur
  • 37,241
  • 25
  • 195
  • 267
samoncode
  • 466
  • 2
  • 7
  • 23

1 Answers1

0

I would assume that you are trying to write to the file system from your application. In that case the "C" comes from the server. ASP.Net and IIS know where your application resides on the server and are mapping the path from the URL to the file system (C:). It works when you start things from Visual Studio because it's being run under an account that has write permissions to the file system. The IIS Application Pool User that is running on your server does not have write permissions. To resolve this issue you can give that user write permissions. You can see how to do that in this post.

Community
  • 1
  • 1
Josh
  • 1,724
  • 13
  • 15