Announcements
No record found.
Hi,
I set the unsecure config to the following JSON: {/DebugVirtualPlugin/:/true/} Per online jsonlint.com, it’s a valid JSON
Trace log of the unsecure config string Code: Context.Trace($/unsecure: {unsecure.EscapeInterpolation()} ); Output: unsecure: {/DebugVirtualPlugin/:/true/}
Trying to deserialize the JSON into the following class: public class UnsecureConfig { [JsonPropertyName(/DebugVirtualPlugin/)] public string DebugVirtualPlugin { get; set; } }
Code to deserialize var unsecureConfig = System.Text.Json.JsonSerializer.Deserialize<UnsecureConfig>(/{///DebugVirtualPlugin///:///true///}/);
Error System.Runtime.Serialization.SerializationException: Element 'http://schemas.datacontract.org/2004/07/System.Collections.Generic:value' contains data from a type that maps to the name 'Model.Config:UnsecureConfig'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name 'UnsecureConfig' and namespace 'Model.Config'.
This error happens when I am trying to deserialize in plugin code, but in a Test method, it deserializes without a problem:
[TestMethod] public void DeserializeJson_UnsecureConfig_Test() { var json = /{///DebugVirtualPlugin///: ///true///}/; var unsecureConfig = System.Text.Json.JsonSerializer.Deserialize<UnsecureConfig>(json); Assert.IsTrue(unsecureConfig.DebugVirtualPlugin == /true/); }
Any thoughts?
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
ManoVerse 202 Super User 2026 Season 1
CU11031447-0 100
NeerajPawar 70