Closed Dexus closed 3 months ago
I am just reaching my limits, I have
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <RuntimeIdentifier>browser-wasm</RuntimeIdentifier> <Nullable>enable</Nullable> <!-- Not embedding binaries to source module reduces build size by ~30%. --> <BootsharpEmbedBinaries>false</BootsharpEmbedBinaries> <!-- Disabling non-essential .NET features reduces minimal build size by ~35%. --> <BootsharpAggressiveTrimming>false</BootsharpAggressiveTrimming> <!-- Enable multi-threaded mode to run CPU-intensive tasks on worker threads. --> <WasmEnableThreads>true</WasmEnableThreads> </PropertyGroup>
and try to use System.Text.Json.JsonSerializer.Serialize
System.Text.Json.JsonSerializer.Serialize
[System.Serializable] public class RequestSecurity { public string Signature { get; set; } public string CodeString { get; set; } public DateTime? CreationTime { get; set; } public string Nonce { get; set; } } RequestSecurity p = new RequestSecurity { Signature = jsonResponse2Signature, CodeString = jsonResponse2, CreationTime = DateTime.Now, Nonce = HmacHash256.RandomString(32) }; string json = System.Text.Json.JsonSerializer.Serialize<RequestSecurity>(p);
but the json string is always {} I'm not sure how I can prevent this.
{}
My C# experiens is now 1 week... sorry for that.
Not sure how is this related to Bootsharp. I'd suggest looking for System.Text.Json docs/tutorials.
System.Text.Json
I am just reaching my limits, I have
and try to use
System.Text.Json.JsonSerializer.Serialize
but the json string is always
{}
I'm not sure how I can prevent this.My C# experiens is now 1 week... sorry for that.