You can only cast between "related" types, or between types which have a cast operator defined (using either the
explicit
or
implicit
keywords :
Conversion operators - C# Programming Guide | Microsoft Docs[
^]
Think about it: if you declare three classes:
public class Fruit {...}
public class Apple : Fruit {...}
public class Orange : Fruit {...}
Then you can cast an Apple to a Fruit, or an Orange to a Fruit, or a Fruit to either an Apple or an Orange (but you may get a run time error if you try) - but you can't cast a Orange to an Apple or vice versa (and that's why you could get the run time error I mentioned) because an Apple contains information that an Orange doesn't: a RemoveCore method method perhaps. And if you could cast it, then when you tried to call RemoveCore it would fail at runtime because it can't find the method.
In essence, you can cast a derived class to any of the classes it is derived from (or interfaces it implements), and you can compile while casting from a base class to any class derived from it (or from an interface to a class that implements it ) - but you may fail at run time if the actual object instance isn't compatible.
To do any other casting, you need to tell the system exactly what can be casted by proving
explicit
or
implicit
operators to actually do it.
And that is what you error message is saying: "this object cannot be converted to this type" so use the compiler (if that generates the error) or debugger (if your code compiles), and look at the actual line that gives the error to find out what data you are trying to convert or pass incorrectly.
We can't do that for you!