I have written the following simple test in trying to learn Castle Windsor\'s Fluent Interface:
using NUnit.Framework;
using Castle.Windsor;
using System.Col
The solution to this for me was not mentioned above, so I thought I would add my answer to the long tail...
I ended up having an old reference to a class (an HttpHandler
) in web.config that was no longer being used (and was no longer a valid reference). For some reason it was ignored while running in Studio (or maybe I have that class still accessible within my dev setup?) and so I only got this error once I tried deploying to IIS. I searched on the assembly name in web.config, removed the unused handler reference, then this error went away and everything works great. Hope this helps someone else.
Just run into this with another cause:
running unit tests in release mode but the library being loaded was the debug mode version which had not been updated
I got the same error after updating a referenced dll in a desktop executable project. The issue was as people here mentioned related an old reference and simple to fix but hasn’t been mentioned here, so I thought it might save other people’s time.
Anyway I updated dll A and got the error from another referenced dll let’s call it B here where dll A has a reference to dll B.
Updating dll B fixed the issue.
I had this issue after factoring a class name:
Could not load type 'Namspace.OldClassName' from assembly 'Assembly name...'.
Stopping IIS and deleting the contents in Temporary ASP.NET Files
fixed it up for me.
Depeding on your project (32/64bit, .net version, etc) the correct Temporary ASP.NET Files
differs:
%systemroot%\Microsoft.NET\Framework64\{.netversion}\Temporary ASP.NET Files\
%systemroot%\Microsoft.NET\Framework\{.netversion}\Temporary ASP.NET Files\
%temp%\Temporary ASP.NET Files
I just resolved this by running the iisreset command using the command prompt... Always the first thing I do when I get such errors.
Is the assembly in the Global Assembly Cache (GAC) or any place the might be overriding the assembly that you think is being loaded? This is usually the result of an incorrect assembly being loaded, for me it means I usually have something in the GAC overriding the version I have in bin/Debug.