'Access is denied' error

D

David

I'm developing an ASP.NET application to run on Win2K
server with IIS 5.1, which has run perfectly happily in
various development, test and staging environments. I've
recently deployed it on one of our production servers and
I'm getting an intermittent 'Access is denied' error when
pages are loading. The file being accessed is an xml
globalisation file that is used to load the text for the
page according to the language settings of the browser.

I've tried a sledgehammer approach of granting 'Everyone'
full control of the file and the folder it is in, to no
avail. I've also tried removing Temporary ASP.NET Files
from the indexing service, as I've seen that suggested as
a solution in various places. Again this didn't work (the
indexing service is set to 'Manual' on the server anyway).

All the pages load fine when I'm logged onto the server
via terminal services client, using an administrative
account. Also, strangely, I can access the site from my
own machine for a while after I've accessed it from the
server - almost as if something has been reset.

I've got integrated security switched on with no anonymous
access as it is an intranet app.

Any suggestions as to the cause of the problem would be
greatly appreciated...

Thanks in advance.

David.
 
K

Keith

Check your settings of how you are opening the file up.
Make sure you don't have an exclusive lock on the file.

Also make sure you are closing the stream when you are
done with it.

Keith
 
D

David

Hi Keith,

Thanks for your swift response.

The application uses the Load method of the XmlDocument
class to load the file (the name and location of which is
specified by the parameter to the Load method). This class
doesn't appear to have an explicit close method.

I find it difficult to believe that it's a problem with
the code itself as it runs ok on other machines. I would
have thought it's more likely to be an environment
problem - possibly with IIS.

Unfortunately, the problem didn't go away over the
weekend, so any further suggestions would be appreciated...

Thanks,

David.
 
J

Jacob Yang [MSFT]

Hi David,

I agree with you that this issue should not be caused by the code since it
runs fine on the other machines.

Based on my research and experience, this issue should be a permission
issue. Please try to impersonating a local administrator User for All the
Requests of an ASP.NET Application. Please refer to the following article
for the detailed information.

INFO: Implementing Impersonation in an ASP.NET Application
http://support.microsoft.com/default.aspx?scid=kb;en-us;306158

I hope it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeff

Is the file local to the server or are you getting at the file through a UNC
path?

Jeff
 
D

David

Just thought I'd post the answer to this so that everyone
can benefit...

The problem was resolved by changing a setting in the
machine.config file. The userName attribute in the
processModel section was set to 'machine' - I changed it
to be 'system' and it worked fine.

I think there's a knowledge-base article on this issue as
I had already made this change on another of our servers.
Unfortunately I haven't got the article reference.

Thanks to all those who responded to my post.

David.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top