For the past day and a half, I’ve been swimming in programming misery trying to figure out why I couldn’t cast something. Suppose the following psuedo-classes:
public interface IFoo
{
public string Foo();
}
public class Derived : IFoo
{
public Derived()
}
public class MainApp()
{
public MainApp()
{
Derived derived = new Derived();
IFoo foo = derived as IFoo; //this should cast derived to IFoo, but it doesn’t
}
}
Does it make sense that derived can’t be cast to IFoo even though derived implements IFoo?!?! As Doc from Back to the Future might say, this breaks the time space C# continium.
It turns out that Derived couldn’t cast to IFoo because they were compiled into different assemblies. VS thinks that derived and IFoo are different types because it loaded two different copies of the same Derived assembly. At least that’s the explanation, for now. I had a hunch that was the case but couldn’t prove it because I’m too retarded to use VS’s debugger properly. Thank god for genuis coworkers.
I’m not sure what the right fix is, perhaps compile all the assemblies into a single directory or something so that only one assembly gets loaded. Whatever it is, this was a GREAT bug to break me back into programming. It reminds me of why I don’t want to be doing this for the rest of my life.

* Comic is a hack, just like my code
I think you’re looking in the wrong place because you can derive all you want from other assemblies and it will work fine (otherwise that would defeat the purpose of being able to create interfaces and assemblies). I’m guessing maybe you have multiple classes that are named the same thing in both namespaces or some similar that’s confusing it. Try fully qualifying your classes if you aren’t already.