weird castings and the “solution”


So I was bugged by some kind of weird error message from Visual Studio and the .NET Framework… I even tried to debug it in Visual Studio 2005 Beta 2… and I got this “funny” error message:




“Unable to cast object of type multeem.IRC.IRCServer to type multeem.IRC.IRCServer

After trying this and that the whole day without any progress I got a tip from Alex here…

“The problem results of the fact that IRCServer.dll is located in the program folder (bin\Debug) and in the plugins folder (bin\Debug\Plugins). If you delete IRCServer.dll from the plugins directory it will work.
Seems like .NET is confused by a type that’s defined in two assemblies that are loaded at the time of the cast/assignment.”

Thank you Alex!!

Comments are closed.