Automated-Fact-Checking-Resources
Automated-Fact-Checking-Resources copied to clipboard
A network-related or instance-specific error occurred while establishing a connection to SQL Server with versions > 4.2.0
Bug Report / Support Request Template
I am running into the error in the title when upgrading the sink to versions above 4.2.0
Code generating the error:
var connString = System.Cfiguration.ConfigurationManager.ConnectionStrings["Configuration"]
.ConnectionString;
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Debug()
.WriteTo.Console()
.WriteTo.MSSqlServer(
connString,
"Log",
restrictedToMinimumLevel: LogEventLevel.Information,
autoCreateSqlTable: true)
.CreateLogger();
The sink does not connect to the DB server when using any version higher than 4.2.0. It connects fine when using version 4.2.0.
List the names and versions of all Serilog packages used in the project:
- Serilog: 2.11
- Serilog.AspNetCore: 6.0.1
- Serilog.Extensions.Hosting: 5.0.1
- Serilog.Extensions.Logging: 3.1.0
- Serilog.Formatting.Compact: 1.1.0
- Serilog.Settings.Configuration: 3.3.0
- Serilog.Sinks.Console: 4.0.1
- Serilog.Sinks.Debug: 2.0.0
- Serilog.Sinks.File: 5.0.0
- Serilog.Sink.PeriodicBatching: 2.3.1
- Serilog.Sinks.MSSqlServer: 5.7.1 (doesn't work) / 4.2.0 (works)
- (configuration, etc.)
Target framework and operating system:
[ ] .NET Core 6 [ ] .NET Core 3.1 [x] .NET Framework 4.8 [ ] .NET Framework 4.7 [ ] .NET Framework 4.6.x
OS: Windows 10
Hi @campanellaf!
Do you see any errors in SelfLog (https://github.com/serilog-mssql/serilog-sinks-mssqlserver#always-check-selflog-first)?
I will close this error as no response for more than six months came from the reporter.