Closed
Description
I work on a console developed in .net core 2.0.
In the appsettings.json file, i have this declaration:
"Serilog": {
"Using": [ "Serilog.Sinks.MSSqlServer" ],
"MinimumLevel": "Information",
"WriteTo": [
{
"Name": "MSSqlServer",
"Args": {
"connectionString": "Server=.;Database=Serilog;Trusted_Connection=True;MultipleActiveResultSets=true;",
"tableName": "log",
"columnOptionsSection": {
"customColumns": [
{
"ColumnName": "EventType",
"DataType": "int",
"AllowNull": false
},
{
"ColumnName": "Release",
"DataType": "varchar",
"DataLength": 32
}
]
},
"autoCreateSqlTable": "true"
}
}
]
}
The log table have a properties column's datatype set to nvarchar(max), not xml.
A workaround is to exexute this command :
ALTER TABLE [dbo].[log] ALTER COLUMN Properties XML