Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8799525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:20:49+00:00 2026-06-14T00:20:49+00:00

I have an application that is getting a System.UnauthorizedAccessException error when it tries to

  • 0

I have an application that is getting a System.UnauthorizedAccessException error when it tries to read from the file system.

I looked at the app pool and I see that is using Network Service for it’s identity. The IIS application is allowing anonymous authentication using an existing account, lets call it IUSR-MYSERVER. It also has Integrated Windows authentication enabled.

If I go to the folder in question and Add Everyone with Read+Execute permissions the error goes away. But if I add IUSR-MYSERVER or NETWORK SERVICE with the same permissions, I still get the same error.

When I look at the error’s entry in my Event Log it has the User as N/A.

What user is my application trying to access the file system as? I assume it would be bad to just use Everyone?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:20:51+00:00Added an answer on June 14, 2026 at 12:20 am

    If the web application uses impersonation, then the file would be accessed by the currently logged in user (or IUSR for anonymous users) – using Integrated Windows Authentication and IE would result in single sign on so the user opening the browser would be accessing the file.

    If the impersonation is not used, then application pool identity is used.

    To determine the currently logged in user in code, use System.Threading.Thread.CurrentPrincipal.Identity.Name – but note that this does not represent the account which is accessing the file.

    To determine the actual identity under which the code is executing, use System.Security.Principal.WindowsIdentity.GetCurrent().Name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the following error on a Windows Forms application that I have
I am getting a fatal error in an application that I have been working
I have a simple monitoring application that is getting some values from PerfMon counters.
I'm getting an error that is baffling me complete. I have a .NET Application
This is getting me quite confused: I have a small application that uses a
I have application that is up more than 3 days. I can see in
We use MVC controllers that access System.File.IO in our application and they work fine
I have an application that calls a web service... I get an error that
I have a web application that runs multiple websites from one codebase. I have
I have a system that we have recently developed - a web application over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.