2

I have a .net v4 web app which uses impersonation as our web server and database server are on separate physical servers.

When we attempt to run the application we receive a server error

    Could not load file or assembly '######' or one of its dependencies. Access is denied. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileLoadException: Could not load file or assembly '######' or one of its dependencies. Access is denied.

Looking at the stack trace it seems the application doesn't have access to

C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET 

If I grant the impersonation user permissions on this folder the application works fine. But if we compile the application down to 3.5, this obviously uses the .net 2 runtime and we don't have to give the impersonation user permissions on the folder "Temporary ASP.NET" in the .net 2 framework folder.

So my question is why do we have to give permissions on this folder for .net v4, but for anything less it works fine?

Adrian S
  • 1,007
  • 4
  • 12
  • 26
  • 1
    Does this help? http://msdn.microsoft.com/en-us/library/aa302435.aspx – Tom Studee Jul 20 '11 at 17:12
  • 2
    Related: http://stackoverflow.com/questions/5239533/impersonation-in-net-crashes-when-reading-registry-keys-linklabel-securityexcep – BlueRaja - Danny Pflughoeft Jul 20 '11 at 17:48
  • This is now sorted, it was found to be a server config issue within the global web config. We should have been using the E drive for our compliation directory and not the C drive. – Adrian S Aug 25 '11 at 20:25

1 Answers1

0

This is now sorted, it was found to be a server config issue within the global web config. We should have been using the E drive for our compliation directory and not the C drive

Adrian S
  • 1,007
  • 4
  • 12
  • 26