# .NET NEST 7.17.5 and Elastic Version 9.0.2

**URL:** <https://discuss.elastic.co/t/net-nest-7-17-5-and-elastic-version-9-0-2/379165>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [June 13, 2025, 12:21pm UTC](https://discuss.elastic.co/t/net-nest-7-17-5-and-elastic-version-9-0-2/379165 "2025-06-13T12:21:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![urbanjasmine](https://avatars.discourse-cdn.com/v4/letter/u/8c91f0/32.png) [@urbanjasmine](https://discuss.elastic.co/u/urbanjasmine)\
**Post date:** [June 13, 2025, 12:21pm UTC](https://discuss.elastic.co/t/net-nest-7-17-5-and-elastic-version-9-0-2/379165/1 "2025-06-13T12:21:38Z")

</div>

Hello everyone,

We have been using the NEST .NET package to connect to Elastic and make calls/searches.  
Current situation:  
.NET Nest **7.17.5**  
Elastic version **8.16.3**.

To maintain compatibility, we are using the following option when initialising the ElasticClient:

```auto
            var pool = new StaticConnectionPool(new[] { xxx });

            var settings = new ConnectionSettings(pool)
                .DefaultFieldNameInferrer(p => p)
                .DisableDirectStreaming()
                .ThrowExceptions(false)
                .MaximumRetries(3)
                .EnableApiVersioningHeader(); // we use this property for compatibility

            var client = new Nest.ElasticClient(settings);

```

We just got a cluster with an Elastic 9.0.2 version on it today. I wanted to check whether our .NET Nest client is compatible with this version.  
I have noticed that removing the .EnableApiVersioningHeader() property allows me to index documents and perform searches.  
**Using the property throws an exception.**

```auto
The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call. Some functionality may not be compatible if the server is running an unsupported product. Call: Status code 400 from: GET /
---> Elasticsearch.Net.PipelineException: The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call. Some functionality may not be compatible if the server is running an unsupported product.

```

Due to the complexity of the project and the large amount of custom logic used, it is not currently possible to upgrade to the newest ElasticClient in the short term.

_ **In general, is NEST 7 compatible with ES 9? If so, is the EnableApiVersioningHeader property still needed?** _

Thanks in advance  
Best regards

---

<div class="post-metadata">

**Author:** ![flobernd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flobernd/32/124877_2.png) [@flobernd](https://discuss.elastic.co/u/flobernd)\
**Post date:** [June 13, 2025, 12:58pm UTC](https://discuss.elastic.co/t/net-nest-7-17-5-and-elastic-version-9-0-2/379165/2 "2025-06-13T12:58:07Z")

</div>

Hi @urbanjasmine ,

I'm sorry, but NEST (v7) is **not compatible** with Elasticsearch 9 (see [compatiblity matrix](https://github.com/elastic/elasticsearch-net?tab=readme-ov-file#compatibility)):

> Given a constant major version of the client, each related minor version is compatible with its equivalent- and all later Elasticsearch minor versions of the **same or next higher** major version.

We released a few blog posts about NEST in the past:

- [Elasticsearch .NET client evolution: From NEST to Elastic.Clients.Elasticsearch - Elasticsearch Labs](https://www.elastic.co/search-labs/blog/net-client-evolution)
- [NEST lifetime extended & Elastic.Clients.Elasticsearch (v8) Roadmap - Elasticsearch Labs](https://www.elastic.co/search-labs/blog/nest-lifetime-extension-v8-roadmap)

To summarize:

NEST is already deprecated since already ~1 year. The lifetime has been extended until end of this year, but after that point, we won't even release security fixes.

For this reason I would highly recommend you to start with the migration. `NEST` and `Elastic.Clients.Elasticsearch` can be used side-by-side in the same project which allows you to gradually upgrade parts of your solution.

> I have noticed that removing the .EnableApiVersioningHeader() property allows me to index documents and perform searches.

If the header is missing, the server assumes a client of the same major version (9) and disables the compatibility layer.

Since NEST is not really compatible with 9.x, this will cause unexpected behavior. We won't provide any support in this case (see also: [Client hardcodes Accept header version with no override, breaking compatibility with older Elasticsearch servers · Issue #8526 · elastic/elasticsearch-net · GitHub](https://github.com/elastic/elasticsearch-net/issues/8526)).
