You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It will throw the following exception.
Unhandled exception. Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property 'Value' with type 'System.Management.Automation.PSMethod[System.Management.Automation.MethodGroup1[System.Func`1[System.String]]]'. Path 'ToString'
In PowerShell SDK 7.2, the PSObject class is marked as [Serializable] so that the matched contract is SerializableContract. However, in PowerShell SDK 7.4, this attribute has been removed because it is obsolete in .NET 8. So PSObject uses DynamicContract.
Can we get it fixed? Otherwise, PSObject is not able to work with Newtonsoft.Json.
The text was updated successfully, but these errors were encountered:
The following code works in .NET 6 + Microsoft.PowerShell.SDK 7.2 but not with .NET 8 + Microsoft.PowerShell.SDK 7.4.
It will throw the following exception.
Unhandled exception. Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property 'Value' with type 'System.Management.Automation.PSMethod
[System.Management.Automation.MethodGroup
1[System.Func`1[System.String]]]'. Path 'ToString'The cause is this line https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs#L1240.
In PowerShell SDK 7.2, the PSObject class is marked as [Serializable] so that the matched contract is SerializableContract. However, in PowerShell SDK 7.4, this attribute has been removed because it is obsolete in .NET 8. So PSObject uses DynamicContract.
Can we get it fixed? Otherwise, PSObject is not able to work with Newtonsoft.Json.
The text was updated successfully, but these errors were encountered: