Saturday, May 3, 2008

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

Standard Solution
This is one of the most irritating build errors a developer might see, especially while setting up an existing .NET application on a fresh machine. I have found one solution that works always. Go to:

"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files"
( Modify the framework version, root directory etc according to your environment. )

Now, right-click and open up the Security tabs for this folder. Grant "Full control" to the 'users' group. (Modify will also work, thought I didn't try it out) However, it this is a security problem for your environment to grant full control to all users in Users group, another Solution could be to put the concerned assemblies lo GAC which I avoided as it was not logical to put the assemblies into GAC in my scenario. Hope this helps.

My Experience
In reality I did the above and it didn't fix the problem so I had to right click each dll that had the problem in the projects bin folder (not temporart asp.net folders) and add group everyone and give it full permissions.

No comments: