views:

710

answers:

5

I am stuck with one asp.net error. My application work fine on development and test environemnt. But on production it give me following error.

Could not load file or assembly 'someProject' or one of its dependencies. Access is denied.

I need immediate help.

A: 

Check that the server user has access to the directory where your assemblies are located.

Brian Rasmussen
what do you mean by server user?
Syed Tayyab Ali
The user context you asp.net application is running under.
Brian Rasmussen
it is actually integrated security option. when ever user hit site. it will ask domain\username and password...
Syed Tayyab Ali
I believe that is just used to authenticate the user.
Brian Rasmussen
A: 

Sounds like an incorrectly configured server.

First, verify that the assembly does indeed exist.

Second, verify that your worker process account has access to it.

Chris Lively
i think it exist, i deployed it. all dll are in the bin folders.
Syed Tayyab Ali
That's only half of it. You have to verify that the worker process has access to it. Basically, start going through the IIS settings and compare your production box to the staging box.
Chris Lively
A: 

Are your assemblies in the GAC or in the Bin folder?
Do you use Code Access Security?

Is it possible to copy a debug version with pdb file to live, so you get more information?

Finally which user do you run the application as?
Do you use impersonation or do you run as a specific user?

Bravax
my assemblies are in Bin folder.
Syed Tayyab Ali
Try putting your assemlbies in the GAC, if that solves your problem its a security issue.
Bravax
+2  A: 

Go to Sysinternals and download Process Monitor: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

Then start it up, filter thread and registry actions away. Clear contents. Run your app and get the error, and then stop the collection in process monitor. Now search for an ACCESS DENIED status, and you'll be able to see the exact file that's causing troubles, as well as the user account trying to get access.

Mark S. Rasmussen
A: 

Just delete the bin folder and then agian copy it. Now, it is working...

Syed Tayyab Ali