serilog-mssql / serilog-sinks-mssqlserver

A Serilog sink that writes events to Microsoft SQL Server and Azure SQL
Apache License 2.0
283 stars 148 forks source link

Test cannot be executed for .NET 6 #491

Closed ckadluba closed 1 year ago

ckadluba commented 1 year ago

Bug Report

Please clearly describe what the SQL Sink is doing incorrectly:

If the test suite is executed for the .NET 6 target, no tests are executed but an error message is shown.

Please clearly describe the expected behavior:

The tests should be executed using the .NET 6 build of the sink.

List the names and versions of all Serilog packages used in the project:

Target framework and operating system:

[ x] .NET 6

Provide a simple reproduction of your application code:

  1. Clone the sink GitHub repo locally
  2. Open a powershell session in the source directory and run the following command.
    dotnet test --framework net6.0
  3. Result: the tests are not executed but the following error is shown.

    grafik

    Testhost process for source(s) 'C:\Source\GitHub\ckadluba\serilog-sinks-mssqlserver\test\Serilog.Sinks.MSSqlServer.Tests\bin\Debug\net6.0\Serilog.Sinks.MSSqlServer.Tests.dll' exited with error: Error:
     An assembly specified in the application dependencies manifest (testhost.deps.json) was not found:
       package: 'Newtonsoft.Json', version: '13.0.1'
       path: 'lib/netstandard2.0/Newtonsoft.Json.dll'
    . Please check the diagnostic logs for more information.
    
    Test Run Aborted.
ckadluba commented 1 year ago

Could be fixed by adding a package referenct to Microsoft.NET.Test.Sdk to the tests project.