I did a search on the subject, and the answer I found said that converting a base class to a derived class is not possible. I find this answer to be unsatisfactory, and I wish to make sure that it is indeed the correct answer.
I am writing some code (obviously), and in my code, I have a base class and an inherited class of that base class. There are times I wish to convert the base class to the inherited class. According to section 13.2.3 of the C# specification, this is possible:
"From any class-type S to any class-type T, provided S is a base class of T."
There's also evidence that in the .NET Framework that it's possible (converting WebRequest to HttpWebRequest and Control to TextBox). So why is it I get a runtime error of InvalidCastException when I attempt to explicitly cast an instance of my base class to an instance of a derived class of that base class