ARG! Could not load file or assembly
So i’m in the midst of migrating a fairly large website to new servers. For the web aspect of it, I’m going from Win2k3 / IIS6 to Win2k8 IIS7. Here’s the problem I was faced with:
I have a few .dll files in a bin directory for use throughout the website. When I try to launch the site, I would receive this error:
Parser Error Message: Could not load file or assembly ‘XXXXXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. Access is denied.
After lots of head banging on wall, my friend Joe sends me the fix!
“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.”
And it fixed my problem, woo hoo!
Hope this helps someone else =)
.: Adam