Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

We have a file placed at a shared location.
PLanning to use it from a .NET page to read contents.

Can we provide permissions to NETWORK SERVICE so that the file is accessible from .NET.

I added NETWORK SERVICE as a user on the shared folder but not able to access.

The file is accessible when I impersonate my ID in Web.Config.
But certainly I cannot use my id for Production environment.
Posted

1 solution

You need to find out what account the Application Pool is set to run as. In IIS, find the app pool your site is in and find the account that is running it. That is the account that needs the permissions.
 
Share this answer
 
Comments
Ashok26 3-Feb-13 18:52pm    
Just to make sure I checked it again. App pool is using identity NETWORK SERVICE and I have given NETWORK SERVICE the permissions on the shared folder. Still Access is denied.
ZurdoDev 4-Feb-13 7:47am    
So, is impersonate set to false in your web.config?
Ashok26 24-May-13 6:24am    
Yes.
I do not impersonate. I had even tried to add user with server name and aspnet.

Now, I got to know there is a special format to add $ at end. Need to try that.
ZurdoDev 24-May-13 8:21am    
What identity is your app pool using?
Ashok26 22-Jul-13 19:22pm    
This is what I tried:
Creating a user account and providing permissions on shared drive
Impersonate using this account. In order to make it work, I had to provide few permissions on folders on web server.
It works but there is an issue: After first download, next downloads start failing with an error of "Connection with the server was reset". It allows the complete file to be downloaded to client before the error. I think the file is not getting copied finally from temporary location to the client's selected location.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900