Description
NEST/Elasticsearch.Net version:
7.0.1
Elasticsearch version:
7.2.0
Description of the problem including expected versus actual behavior:
In case of any issues in request to elastic search if no System.Diagnostics.DiagnosticSource installed in project explicitly then UnexpectedElasticsearchClientException is thrown instead of correct exception.
If explicitly add System.Diagnostics.DiagnosticSource v4.5.1(or later) in project then behavior is correct. System.Diagnostics.DiagnosticSource doesn't install automatically with the NEST package.
Steps to reproduce:
- Install NEST 7.0.1 on clean .Net standard 2.0 project.
- Send any request to elastic which produces error.
Provide DebugInformation
(if relevant):
Elasticsearch.Net.UnexpectedElasticsearchClientException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.3.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.3.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)