Why it is wrong with dynamic in vs2013? RRS feed

  • 问题

  • I think i create a dynamic object  with type property , but can not use type property .


    in dll one

    var layer_defs = new List<dynamic>(); layer_defs.Add(new { type = "input", out_sx = 1, out_sy = 1, out_depth = 1 });

    in dll two if (((dynamic)layer_defs [0]).type != "input") //There is an error. can not use type {

    but but in debug layer_defs[0] have type is true.and type value is "input".. whole body not good.

    • 已编辑 AiHobby 2017年3月22日 7:01 补充
    2017年3月22日 1:12