Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load type 'Elasticsearch.Net.IInternalSerializerWithFormatter' from assembly 'Elasticsearch.Net, Version=7.0.0.0, Culture=neutral, PublicKeyToken=96c599bbe3e70f5d'. #313

Closed
aramdata opened this issue Jul 25, 2020 · 5 comments
Assignees

Comments

@aramdata
Copy link

hello ,
when i update all packege of project Audit.net ElasticsearchDataProvider raise this error .
in my project exist package like 'Serilog.Sinks.Elasticsearch' , 'Elastic.Apm.NetCoreAll' .

Audit.NET version :

  • Audit.NET.Elasticsearch:15.3.0
  • Audit.NET:15.3.0
@thepirat000
Copy link
Owner

Include the code or attach a project that reproduces the error

@aramdata
Copy link
Author

<PackageReference Include="Audit.NET.Elasticsearch" Version="15.3.0" />
<PackageReference Include="Elastic.Apm.NetCoreAll" Version="1.6.1" />
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="8.2.0" />
<PackageReference Include="Audit.NET" Version="15.3.0" />
** and in staurtup.cs : **

Audit.Core.Configuration.DataProvider = new ElasticsearchDataProvider() { ConnectionSettings = new AuditConnectionSettings(new Uri(Configuration["ConnectionStrings:ElasticsearchAuditlogConnection"])), IndexBuilder = ev => $"auditlog-{Assembly.GetExecutingAssembly().GetName().Name.ToLower().Replace(".", "-")}-{ev.EventType.ToLower()}", IdBuilder = ev => Guid.NewGuid() };

@thepirat000
Copy link
Owner

Add the following reference on your csproj:

<PackageReference Include="Nest" Version="7.8.1" />

I'll probably update the reference on Audit.Elasticsearch to a newer version of Nest on the next release, but in the meantime you can do it from your csproj.

@aramdata
Copy link
Author

thank you

thepirat000 added a commit that referenced this issue Aug 8, 2020
…320)

- Audit.EntityFramework: Adding boolean `EarlySavingAudit` setting to AuditDbContext to allow the audit event to be saved **before** the entity saving operation takes place. Related to #316.
- Audit.NET.ElasticSearch: Upgrade NEST reference to version 7.8.2 to  fix exception *Could not load type Elasticsearch.Net.IInternalSerializerWithFormatter from assembly Elasticsearch.Net* (#313)
@thepirat000
Copy link
Owner

This was fixed on version 16.0.1 please upgrade your Audit.NET references

@thepirat000 thepirat000 self-assigned this Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants