Difference between ParameterInfo.DefaultValue and ParameterInfo.RawDefaultValue

前端 未结 1 1437
伪装坚强ぢ
伪装坚强ぢ 2021-01-17 12:18

This is a follow-up question of How do I get default values of optional parameters?

From documentation, DefaultValue:

Gets a value indicating

相关标签:
1条回答
  • 2021-01-17 12:45

    There is a subtle but significant difference between "in the context of reflection" and "the reflection-only context". The "reflection only context" is referring to something very specific:

    • How to: Load Assemblies into the Reflection-Only Context

    It is a way to load an assembly for examination only and has the distinct advantage of not requiring any dependent assemblies to be loaded or even to be present.

    Since you appear to have every intention of executing some of the code you are reflecting, the reflection-only context would be of limited use to you.

    0 讨论(0)
提交回复
热议问题