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 745823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T09:37:41+00:00 2026-05-14T09:37:41+00:00

We use MVC controllers that access System.File.IO in our application and they work fine

  • 0

We use MVC controllers that access System.File.IO in our application and they work fine in localhost (IIS 6.0-based Cassini). Deploying to IIS7, we have problems getting the controllers to work because they throw UnauthorizedAccessExceptions.

We have done the following to try to resolve the issue:
– Set NETWORK SERVICE and IUSR accounts to have permission on the files and folders in question
– Ensured the App Pool is running under NETWORK SERVICE and loading the user profile
– Application is running under full trust
– We tried adding impersonation to web.config and giving NETWORK SERVICE write permissions (which was not a great idea because that’s not what we want to do)

Now, we alternate between getting UnauthorizedAccessException and an IIS7 404 page that suggests the routes are being ignored completely (for example we serve “/favicon.ico” via a controller when the physical file actually lives at /content/images/favicon.ico). We used ProcessMonitor to try to track down the issue but weren’t successful.

UPDATE:

This issue is intermittent. We had a brief few minutes where everything worked without making any configuration changes. We’re running on EC2, so this could be related to a distributed file system. We’re also using a separate drive to store all web site data, we’re not using inetpub/wwwroot.

UPDATE 2:

The site works without incident under IIS 7.5, with no configuration changes needed but this is likely due to running with the new AppPoolIdentity. Otherwise it’s an identical deployment. Unfortunately we can’t run R2 on this EC2 instance.

  • 1 1 Answer
  • 1 View
  • 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-05-14T09:37:41+00:00Added an answer on May 14, 2026 at 9:37 am

    The issue turned out to be the controller factory we were using not handling file requests properly.

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

Sidebar

Related Questions

I have 2 attributes that I use within the controllers of my MVC application.
I am transitioning code that used implementations of Spring MVC's Controller to use the
I am trying to use Autofac and Autofac.Integrations.Web to register ASP.NET MVC controllers. I
I use declarative roles in my MVC.NET controllers and I have a custom membership
I have an ASP.NET MVC web app whose controllers use WCF to call into
I have a basic ASP.Net MVC 3 application which has a number of controllers
I'm using ASP.NET MVC with IIS 7.0. I've got 404 errors hooked up fine
I have an ASP.NET MVC 3 application and in my project I use ADO.NET
I have an application that uses Spring Security to control access to pages, to
I'm migrating a Spring MVC controller to use the newer style annotations, and want

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.