I added an AjaxToolkit:AutoCompleteExtender to my ASP.Net 3.5 application. The web service lives in the same web application. Now I am getting this error when I hit F5/Debug
In my case, I was attempting to compile a BizTalk project in VS2010, and I got
Could not load file or assembly 'VJSharpCodeProvider, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A)
None of the other answers in posted so far here worked - but doing this on the user for my BizTalkServices IIS site did. This is only on my local machine, not actual production.
Whie the wisdom of giving the user for an IIS site admin priveledges is certainly debatable, perhas this will offer a clue for finding the real problem for someone.
I was getting the same error, but for a different reason - I was referencing a C++/CLI DLL file.
After a couple of days of banging my head against a wall I downloaded and installed the latest Visual C++ and everything worked.
EDIT: After a couple of days of working with the project, I witnessed this error again in the Fusion logs. It appears that there was a different error hiding in the application: access denied or something like that. So after I fixed the error, this error didn't disappear from the logs, but wasn't breaking anything. So this error might be definitely misleading. Lesson learned: check your application for other errors, before trying to fix this one.
So I think that this is a non-issue. The exception probably gets thrown all the time, but I had turned on "Break when an Exception is thrown" in Debug/Exceptions for all types there, to diagnose an unrelated problem. Since I unchecked the check boxes to their default state, I no longer see the binding problem.
I too have received the same error, but my solution was very different to all of the above. In the web config I had a reference to an Assembly Binding such that it was older than the version I was trying to load eg.
<dependentAssembly>
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
and I was trying to install version 4.2.3. I hope this helps someone!
This happened to me after a BSOD on my machine. Clearing the AppData/Local/Temp/Temporary ASP.NET Files/ folder did it for me, I guess the temp files got corrupted as a result of the crash.
We got this a few times here at work. Here's what we found.