Are methods also serialized along with the data members in .NET?

前端 未结 4 2028
执念已碎
执念已碎 2020-12-06 11:29

The title is obvious, I need to know if methods are serialized along with object instances in C#, I know that they don\'t in Java but I\'m a little new to C#. If they don\'t

4条回答
  •  悲&欢浪女
    2020-12-06 12:11

    Methods aren't serialized.

    I don't know about your scenario, but putting in a library (assembly / dll) and using that in the other end to deserialize gets you all.

    Ps. you probably should create some ask some more questions with the factors involved in your scenario. If you are intending to dynamically send & run the code, you can create awful security consequences.

提交回复
热议问题