As the title says, when I enable PublishTrimmed and set TrimMode to full, the deserialize function reports the following error:
Unhandled Exception: System.ArgumentException: The record type 'Stoream.Engine.Config+Config' is invalid. Required constructor is not defined.
at Microsoft.FSharp.Reflection.Impl.getRecordConstructorMethod(Type, BindingFlags) + 0x1ae
at Microsoft.FSharp.Reflection.FSharpValue.MakeRecord(Type, Object[], FSharpOption`1) + 0x4f
at FSharp.Json.Json.deserializeEx[T](JsonConfig, String) + 0x91
at Stoream.Engine.Server.Server.Start() + 0x42
at stoream-engine!<BaseAddress>+0x441579
[1] 13582 IOT instruction (core dumped)
Stoream.Engine.Config is defined as follows:
type AccountConfig = { Username: String; Password: String }
type ServerConfig = { Hostname: String; Port: UInt16 }
type StorageConfig = { Root: String; Capacity: UInt32 }
type Config =
{ Account: AccountConfig
Server: ServerConfig
Storage: StorageConfig }
static member public CONFIG =
IO.File.ReadAllText("./stoream-engine.json") |> Json.deserialize<Config>
When I set TrimMode to partial this error doesn't occur.
As the title says, when I enable
PublishTrimmed
and setTrimMode
to full, thedeserialize
function reports the following error:Stoream.Engine.Config
is defined as follows:When I set TrimMode to partial this error doesn't occur.