# Nest 6.8.3 getting InvalidProgramException sometimes

**URL:** <https://discuss.elastic.co/t/nest-6-8-3-getting-invalidprogramexception-sometimes/227037>\
**Category:** Elasticsearch\
**Created:** [April 8, 2020, 1:42am UTC](https://discuss.elastic.co/t/nest-6-8-3-getting-invalidprogramexception-sometimes/227037 "2020-04-08T01:42:55Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![cwellborn23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cwellborn23/32/64325_2.png) [@cwellborn23](https://discuss.elastic.co/u/cwellborn23)\
**Post date:** [May 4, 2020, 2:03pm UTC](https://discuss.elastic.co/t/nest-6-8-3-getting-invalidprogramexception-sometimes/227037/4 "2020-05-04T14:03:56Z")

</div>

Not sure if this matters but when we moved from 2.\* to 3.1 .dotnet core we made sure to keep newtonsoft(it was breaking some of our endpoints)

```auto
Install-Package Microsoft.AspNetCore.Mvc.NewtonsoftJson

services.AddMvc().AddNewtonsoftJson();

services.AddControllers().AddNewtonsoftJson();

```

If I do a fresh deploy this goes away for awhile but keeps coming back.  
We are using [https://github.com/DataDog/dd-trace-dotnet/releases/tag/v1.16.1](https://github.com/DataDog/dd-trace-dotnet/releases/tag/v1.16.1) . They claim it is not them.

We are on `<PackageReference Include="NEST" Version="6.8.5" />`

Started happening again in the past week. Still confused on what is causing it. Do you know what the resolution to this was? [Nest 6.6 getting InvalidProgramException sometimes](https://discuss.elastic.co/t/nest-6-6-getting-invalidprogramexception-sometimes/218058)

---

_[View the full topic](https://discuss.elastic.co/t/nest-6-8-3-getting-invalidprogramexception-sometimes/227037)._
