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
When adding a new item , a 500 server error is returned
After activating Debug log level and setting the application in Development mode , the error is as shown bellow.
FIX
The PR #62 fixes the issue, but the ch04 docker image should be re built and pushed.
For book readers
In the mean time the pull request is accepted/merged, you can build and push your own image from ch04 todo-web docker image by adding the 1 line of code bellow to ch04/docker-images/todo-list/src/Startup.cs as shown in the PR. Then, change the todo-web deployment in ch05 accordingly to use your own image.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
ERROR
An unhandled exception occurred while processing the request.
InvalidCastException: Cannot write DateTime with Kind=Local to PostgreSQL type 'timestamp with time zone', only UTC is supported. Note that it's not possible to mix DateTimes with different Kinds in an array/range. See the Npgsql.EnableLegacyTimestampBehavior AppContext switch to enable legacy behavior.
Npgsql.Internal.TypeHandlers.DateTimeHandlers.TimestampTzHandler.ValidateAndGetLength(DateTime value, NpgsqlParameter parameter)
The text was updated successfully, but these errors were encountered:
Todo-list App
When adding a new item , a 500 server error is returned
After activating Debug log level and setting the application in Development mode , the error is as shown bellow.
FIX
The PR #62 fixes the issue, but the ch04 docker image should be re built and pushed.
For book readers
In the mean time the pull request is accepted/merged, you can build and push your own image from ch04 todo-web docker image by adding the 1 line of code bellow to ch04/docker-images/todo-list/src/Startup.cs as shown in the PR. Then, change the todo-web deployment in ch05 accordingly to use your own image.
ERROR
An unhandled exception occurred while processing the request.
InvalidCastException: Cannot write DateTime with Kind=Local to PostgreSQL type 'timestamp with time zone', only UTC is supported. Note that it's not possible to mix DateTimes with different Kinds in an array/range. See the Npgsql.EnableLegacyTimestampBehavior AppContext switch to enable legacy behavior.
Npgsql.Internal.TypeHandlers.DateTimeHandlers.TimestampTzHandler.ValidateAndGetLength(DateTime value, NpgsqlParameter parameter)
The text was updated successfully, but these errors were encountered: