Fork me on GitHub
摘要: InvalidCastException:'timestamp with time zone'. See the Npgsql.EnableLegacyTimestampBehavior AppContext switch to enable legacy behavior. 搜关键词 `EnableLegacyTimestampBehavior`,找到官网的解释:https://www.npgsql.org/doc/types/datetime.html#timestamps-and-timezones 在 `Main` 入口加上 ```C# AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true); ``` 重新执行 `dotnet run` 命令,问题解决。 阅读全文
posted @ 2022-03-28 00:12 VAllen 阅读(2862) 评论(0) 推荐(1) 编辑