Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied.http://forums.asp.net/t/1043427.aspx/1?Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Thu, 10 Nov 2011 13:18:54 -050010434271457962http://forums.asp.net/p/1043427/1457962.aspx/1?Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>I just installed AJAX Beta 2 and the updated AjaxControlToolkit. I'm getting this error when I try to access the site. Any Ideas?<br> </p> <p>&nbsp;</p> <p><b>Stack Trace:</b> <br> <br> </p> <table bgcolor="#ffffcc" width="100%"> <tbody> <tr> <td> <pre>[FileLoadException: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied.]<br> System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&amp; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) &#43;0<br> System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection) &#43;211<br> System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection) &#43;141<br> System.Reflection.Assembly.Load(String assemblyString) &#43;25<br> System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) &#43;32<br><br>[ConfigurationErrorsException: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied.]<br> System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) &#43;596<br> System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() &#43;3487305<br> System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) &#43;46<br> System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) &#43;177<br> System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) &#43;267<br> System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) &#43;36<br> System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) &#43;429<br> System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) &#43;73<br> System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) &#43;580<br> System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) &#43;93<br> System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) &#43;111<br> System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) &#43;54<br> System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) &#43;31<br> System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) &#43;40<br> System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) &#43;139<br> System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() &#43;120<br> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) &#43;155<br></pre> </td> </tr> </tbody> </table> 2006-11-08T21:18:32-05:001458737http://forums.asp.net/p/1043427/1458737.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>You probably need to do one of the following:</p> <p>1. Make the assembly copy local.</p> <p>2. Put the assembly in the GAC.</p> 2006-11-09T12:49:47-05:001458890http://forums.asp.net/p/1043427/1458890.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>Thanks<br> <br> The solution that worked for me was I had to change my permissions on the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files folder. That corrected the issue!<br> </p> 2006-11-09T14:41:03-05:001458942http://forums.asp.net/p/1043427/1458942.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. That would work too. I just prefer to not do that. I would rather either have it in the GAC or have it copy local. 2006-11-09T15:11:15-05:001464925http://forums.asp.net/p/1043427/1464925.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. I'd guess your ASP.NET AJAX install wasn't successful, but it's hard to tell without more information. For what it's worth, the AjaxControlToolkit DLL does NOT need to be in the GAC. 2006-11-14T21:59:09-05:001545328http://forums.asp.net/p/1043427/1545328.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. Well, I'm getting the same error, and so far none of the suggestions have worked.&nbsp; I have a rather large web app that worked fine this morning, but then I upgraded to ASP.NET AJAX 1.0 and now this app gives me this same error.&nbsp; There is only one mention of AjaxControlToolkit in the entire application, on a page in a subdirectory off the main site, but I'm getting this error when I try to go to ANY page on the site.&nbsp; The reference is this: &nbsp;<pre class="prettyprint">&lt;%@ Register Assembly=&quot;AjaxControlToolkit&quot; Namespace=&quot;AjaxControlToolkit&quot; TagPrefix=&quot;cc1&quot; %&gt;</pre> <p>I've got the AjaxControlToolkit.dll&nbsp;file in my Bin folder, and I've&nbsp;re-added it a couple times, and then updated the reference, but no joy.&nbsp; I'm not sure what else to do.</p> <p>One interesting thing that's happening is, I've deployed this app to our development server and it runs fine - no errors, even on the page that references the assembly.&nbsp; However, the development server has NOT yet been upgraded to ASP.NET AJAX 1.0.&nbsp; This error&nbsp;only happens on my local instance...&nbsp; So it appears to be related to the new AJAX release, not the AjaxControlToolkit assembly (I do have the most recent release of the ACT on the dev server in my Bin directory)...</p> <p>If anyone has any other ideas for how I might get this working, please reply!</p> <p>Thanks,</p> <p>eddie</p> 2007-01-23T21:45:33-05:001545400http://forums.asp.net/p/1043427/1545400.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. Try restarting IIS and completely closing/reopening your webbrowser.&nbsp; I had the same error and restarting IIS corrected it.<br> 2007-01-23T22:52:04-05:001546707http://forums.asp.net/p/1043427/1546707.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>I tried what you suggested, but I still get the same error.&nbsp; I did try installing it to the GAC, but I get an Access denied error there as well:</p> <p>&quot;Failure adding assembly to the cache: Access denied.&quot;</p> <p>This is an app that I am constantly updating and re-publishing to the site, so it's got me very concerned since I have to launch a new version of it next week...&nbsp; PLEASE, if anyone can tell me how to resolve this, let me know - I am DESPERATE.</p> <p>Thanks,</p> <p>eddie</p> 2007-01-24T16:12:28-05:001546749http://forums.asp.net/p/1043427/1546749.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>One more thing...&nbsp; If I open up the Sample website from the AjaxControlToolkit and try to compile I get the same error:</p> <p>Error&nbsp;1&nbsp;Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied.&nbsp;&nbsp;</p> <p>So this seems to be a system-wide error.&nbsp; I re-ran the installation of the 1.0 extensions (repair) and the CTP, but no luck...</p> 2007-01-24T16:33:35-05:001546903http://forums.asp.net/p/1043427/1546903.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. Could you try installing the RTW version of ASP.Net AJAX and the new toolkit which released yesterday? I think this may be because your installation may not have been successful. 2007-01-24T18:10:28-05:001547505http://forums.asp.net/p/1043427/1547505.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>Wel, I didn't really change anything, but when I came back from lunch everything seems to be working fine now.&nbsp; I'm really stumped as to what may have caused this, or what may have fixed it, but I'm glad it's working.&nbsp; Now I've got to install asp.net ajax 1.0 on my server and hope the same thing doesn't happen there...</p> <p>BTW, I did have the release of asp.net ajax installed - in fact I uninstalled it a couple times and reinstalled it, so I'm pretty sure the installation was successful.&nbsp; Also, I am using the most recent version of AjaxControlToolkit.dll which came out yesterday...</p> <p>Thanks for all your help, this one, I'm afraid, is a mystery...</p> <p>Eddie</p> 2007-01-25T01:37:53-05:001624202http://forums.asp.net/p/1043427/1624202.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>hey rb_jlm,</p> <p>How is it that you make the AjaxControlToolKit copy local?<br> &nbsp;</p> 2007-03-16T19:40:10-04:001626645http://forums.asp.net/p/1043427/1626645.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>I just added a reference to my project, pointed it to the dll and it added it to my bin folder.&nbsp; I don't have it installed in the GAC...</p> <p>eddie</p> 2007-03-19T14:46:34-04:001802895http://forums.asp.net/p/1043427/1802895.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. The best solution I've found is to delete the TEMPORARY project from the directory: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files.&nbsp; This works a treat, and whenever I crash (which is when I get this error), I can rebuild in minutes&nbsp;- in fact, it works for any reference, not just the AJAX control toolkit.&nbsp; Hope this helps someone else and saves them from pulling their hair out! 2007-07-13T17:59:14-04:001894536http://forums.asp.net/p/1043427/1894536.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>Only grant read and execution&nbsp;permissions to the bin/AjaxControlToolkit.dll file for everyone</p> 2007-09-05T20:20:52-04:001955880http://forums.asp.net/p/1043427/1955880.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>copy to bin folder will do. Check&nbsp;<a href="http://dotnetfish.blogspot.com/2007/10/could-not-load-file-or-assembly.html">http://dotnetfish.blogspot.com/2007/10/could-not-load-file-or-assembly.html</a>&nbsp;</p> 2007-10-15T07:46:26-04:002371050http://forums.asp.net/p/1043427/2371050.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. &lt;div class=ForumPostBodyArea&gt; &lt;div class=ForumPostContentText&gt; <p>I have almost the same problem, i have VS2005 installed on 3 computers in the office, and&nbsp;4 days ago one of them stop work with ajax, i tried to remove the folder into Visual Studio 8 that i named AjaxToolkit and again unzipping the AjaxControlToolkit.zip&nbsp;&nbsp;with the same name, but now i have a builds errors like this:</p> <p>&nbsp;Warning&nbsp;9&nbsp;Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'C:\Archivos de programa\Microsoft Visual Studio 8\AjaxToolkit\SampleWebSite\Bin\AjaxControlToolkit.dll' or one of its dependencies. The module was expected to contain an assembly manifest.&nbsp;PayUp.Web</p> <p>When i trid to add the reference in my web project a warning icon&nbsp;shows in the reference Ajaxcontroltoolkit reference, and the propierties&nbsp;&nbsp;dont fill the culture,&nbsp;description, version, etc, and in the others computers the reference ajaxcontroltoolkit's propierties fill all the fields correctly.</p> <p>&nbsp;I tried to remove the temporaly files in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 but the error still there and i have tried to unistall the VS05 and the error still there.</p> <p>&nbsp;I dont know how to do!!</p> &lt;/div&gt;&lt;/div&gt; 2008-05-21T11:44:30-04:002411327http://forums.asp.net/p/1043427/2411327.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>Here's what I did to resolve this under VS2008 (its probably very similar under VS2005):</p> <p>First, on any project where I'm using dlls, I always create a dll folder to hold them.&nbsp; I NEVER rely on the bin folder for references (since that would be cleared out when running a clean operation and most source control programs do not include the bin file when checking in/out) or on local copies of the dll (c:\ajax\2.0\bin\ajaxcontroltoolkit.dll).&nbsp; Sure, the build operation puts a copy there but thats its job--leave the bin file to the build script.&nbsp; If you ever work on your code somewhere else, publish it to another machine, or hand it off to someone else; you don't have to worry about whether the new machine has its ajaxcontroltoolkit.dll installed in the same location on its hard drive as yours.&nbsp; As a side note, under the properties -&gt; advanced for the dll, I have a build action set to content and a copy to output directory set to do not copy<br> </p> <p>Second, I go into the references, remove any current ajaxcontroltoolkit references (or any other special dlls that I was using and am moving to the dll folder),&nbsp; and add the dll references back in pointing to the copies in my dll folder. </p> <p>Thirdly, if I'm going to be using something like the ajaxcontroltoolkit on most of my pages, I go ahead and throw the following into the web.config file so I dont have register statements on every page:</p> <pre class="prettyprint">&lt;configuration&gt; &lt;system.web&gt; &lt;pages&gt; &lt;controls&gt; &lt;add tagPrefix=&quot;cc1&quot; assembly=&quot;AjaxControlToolkit&quot; namespace=&quot;AjaxControlToolkit&quot;/&gt; &lt;/controls&gt; &lt;pages&gt; &lt;compilation&gt; &lt;assemblies&gt; &lt;add assembly=&quot;AjaxControlToolkit&quot;/&gt; &lt;/assemblies&gt; &lt;/compilation&gt; &lt;/system.web&gt; &lt;/configuration&gt;</pre> <p>Hope this helps, it took me a while to get it right </p> <p>If this is an intermittent problem for you (ie, it works for a bit after a build and then you get a parser error), try stopping and starting IIS. In my case, the ajaxcontroltoolkit that the build script had placed in the bin folder was being replaced with an earlier verison of the toolkit. Restarting IIS seems to have fixed this. Since doing this, my version in the bin folder has not reverted to 1.16xxx, it stays a 1.19xxx and I don't have any more frustrating errors.</p> <br> 2008-06-09T16:46:15-04:002598319http://forums.asp.net/p/1043427/2598319.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. <p>I too have a website, which emits these errors at random. ASP.NET is a great idea and has worked well for me many years.</p> <p>It appears, however, that Microsoft is now losing grips of its product, as to which the sporadic nature of this issue can only attest.</p> <p>It seems that an overall goal of Microsoft is to weave their users/developers into a net, from which it is diffult to migrate. </p> <p>Now that javascript libraries such as jquery has reached maturity it would seem a good occasion to look for alternatives to the ASP.NET heavyweighter and adopt for more to-the-point methods such as jquery &#43; web services.</p> <p>Best regards<br> Andreas<br> </p> 2008-09-03T18:18:24-04:002610036http://forums.asp.net/p/1043427/2610036.aspx/1?Re+Could+not+load+file+or+assembly+AjaxControlToolkit+or+one+of+its+dependencies+Access+is+denied+Re: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied. You may receive this error if you are running your site with impersonation.&nbsp; Check your web.config impersonation tag and/or the security context that the particular user is running under:<br> &lt;br /&gt;&lt;br /&gt;<font color="#008000" size="2"><font color="#008000" size="2"></font></font><font color="#008000" size="2"><font color="#008000" size="2"><font color="#0000ff" size="2"><font color="#0000ff" size="2"> <p>&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">identity</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2"> </font></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">impersonate</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=</font></font><font color="#000000" size="2">&quot;</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">true</font></font><font color="#000000" size="2">&quot;</font><font color="#0000ff" size="2"><font color="#0000ff" size="2"> </font></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">userName</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=</font></font><font color="#000000" size="2">&quot;</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">UserName</font></font><font color="#000000" size="2">&quot;</font><font color="#0000ff" size="2"><font color="#0000ff" size="2"> </font></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">password</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=</font></font><font color="#000000" size="2">&quot;</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">Password</font></font><font color="#000000" size="2">&quot;</font><font color="#0000ff" size="2"><font color="#0000ff" size="2"> /&gt;</font></font></p> <p><font color="#0000ff" size="2"><font color="#0000ff" size="2">&nbsp;&lt;br /&gt;&lt;br /&gt;</font></font></p> <p></font></font>In my case, the fix was changing the user that was being impersonated on my local machine.&nbsp; I was able to pinpoint it&nbsp;to this issue because the site was working on my local machine with my development web.config, but not with my live web.config, and this was one of the main differences.&nbsp; I didn't make it as far as determining what specific security access was different between the two users.&nbsp; I tried granting my live web.config impersontated user full access to the bin folder on my local machine to no avail.</p> 2008-09-09T14:57:40-04:00