# Elastic.Apm.NetCoreAll with Serilog

**URL:** <https://discuss.elastic.co/t/elastic-apm-netcoreall-with-serilog/341991>\
**Category:** Elasticsearch\
**Tags:** infrastructure-observability\
**Created:** [August 30, 2023, 3:08pm UTC](https://discuss.elastic.co/t/elastic-apm-netcoreall-with-serilog/341991 "2023-08-30T15:08:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [August 30, 2023, 3:08pm UTC](https://discuss.elastic.co/t/elastic-apm-netcoreall-with-serilog/341991/1 "2023-08-30T15:08:57Z")

</div>

Good afternoon,

I have services in .net6 and in this moment I'm using the next nugets:

- Elastic.Apm.NetCoreAll (1.20.0)
- Elastic.Apm.SerilogEnricher(1.5.3)

I would like upgrade the packages but when I use the version 1.22 of NetCoreAll I have this error:

The singleton APM agent has already been instantiated and can no longer be configured.

I know that the message means that I'm creating 2 instances, but I think that the problem is the compatibility of the two libraries?

In serilog the next version is 8.6...

Someone has the same problem?

Thanks for all!

---

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [August 31, 2023, 5:15am UTC](https://discuss.elastic.co/t/elastic-apm-netcoreall-with-serilog/341991/2 "2023-08-31T05:15:26Z")

</div>

Sorry, the version of the service is .Net7

---

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [September 1, 2023, 10:01am UTC](https://discuss.elastic.co/t/elastic-apm-netcoreall-with-serilog/341991/3 "2023-09-01T10:01:06Z")

</div>

I saw the problem. Was an error code, I have a middleware that create another transaction but only in the version 1.22

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 29, 2023, 10:01am UTC](https://discuss.elastic.co/t/elastic-apm-netcoreall-with-serilog/341991/4 "2023-09-29T10:01:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
