ProfessorAire/Evands.Pellucid-Crestron

Dump() throws a RestrictionViolationException when dumping some classes.

Closed this issue · 2 comments

Have run into this with several classes, most recently when trying to dump a class that contained a System.Net.NetworkInformation.PhysicalAddress.

--------Exception 1--------
Crestron.SimplSharp.Reflection.RestrictionViolationException: RestrictionViolationException: System.Net.NetworkInformation.PhysicalAddress - Not allowed due to restrictions
  at Crestron.SimplSharp.Reflection.CTypeImpl.set_InnerObject (System.Object value) [0x001a7] in <e0309a5132444b8e8c38e7c1bfa9d6f0>:0
  at Crestron.SimplSharp.Reflection.MemberInfo.Create[T] (System.Reflection.MemberInfo memberInfo) [0x00230] in <e0309a5132444b8e8c38e7c1bfa9d6f0>:0
  at Crestron.SimplSharp.Reflection.TypeExtensions.GetCType (System.Type type) [0x00072] in <e0309a5132444b8e8c38e7c1bfa9d6f0>:0
  at Evands.Pellucid.Terminal.Formatting.Formatters.ProcessEntry (System.Collections.Generic.KeyValuePair`2[TKey,TValue] entry, System.Int32 width, System.Int32 subLevel, System.Int32 minListPadding) [0x0001b] in <2ef2183c1dec401bb191e74712100539>:0
  at Evands.Pellucid.Terminal.Formatting.Formatters.FormatObjectForConsole (System.Object obj, System.Int32 subLevel, System.Int32 minListPadding) [0x0056c] in <2ef2183c1dec401bb191e74712100539>:0
  at Evands.Pellucid.Terminal.Formatting.Formatters.FormatObjectForConsole (System.Object obj) [0x00018] in <2ef2183c1dec401bb191e74712100539>:0
  at Evands.Pellucid.Extensions.Dump (System.Object obj) [0x0000d] in <2ef2183c1dec401bb191e74712100539>:0
  at Masters_Gold_Exam.Core.FlexPod..ctor (Masters_Gold_Exam.Config.ManifestItems.Pod podConfig) [0x000a8] in <0c254001994f4abaad0bf9afb0325149>:0
  at Masters_Gold_Exam.Core.FlexPodManager..ctor (Masters_Gold_Exam.Config.Manifest manifest) [0x00036] in <0c254001994f4abaad0bf9afb0325149>:0
  at Masters_Gold_Exam.Core.SystemManager.Initialize () [0x00019] in <0c254001994f4abaad0bf9afb0325149>:0
  at Masters_Gold_Exam.Core.ControlSystem.<InitializeSystem>b__9_0 (System.Object _) [0x00020] in <0c254001994f4abaad0bf9afb0325149>:0
-----------------------------

This should be resolved by the changes made in #67. When dumping an object any exceptions generate an additional list that will provide information about each property that encountered an exception, as shown below:

image

Resolved in release v1.3.0.