Much to my dismay, the follow code wont compile.
It will however compile if I remove the ref keyword.
class xyz
{
    static void foo(ref object aaa)
    {
    }
    static void bar()
    {
        string bbb="";
        foo(ref bbb);
        //foo(ref (object)bbb); also doesnt work
    }
}
- Can anyone explain this? Im guessing it has something to do with ref's being very strict with derived classes. 
- Is there any way I can pass an object of type string to - foo(ref object varname)?
 
     
     
     
    