# ScrollAll : .Net Framework versus .Net Core

**URL:** <https://discuss.elastic.co/t/scrollall-net-framework-versus-net-core/196847>\
**Category:** Elasticsearch\
**Created:** [August 26, 2019, 10:53pm UTC](https://discuss.elastic.co/t/scrollall-net-framework-versus-net-core/196847 "2019-08-26T22:53:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pascal62](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@Pascal62](https://discuss.elastic.co/u/Pascal62)\
**Post date:** [August 26, 2019, 10:53pm UTC](https://discuss.elastic.co/t/scrollall-net-framework-versus-net-core/196847/1 "2019-08-26T22:53:35Z")

</div>

```
           I have code performing scrolling query that works fine under .Net Framework 7.4.2 but when rebuild under .Net Core and executed in that environment raise an Elastic exception as shown below.

Is there any difference between using ScrollAll under .Net Framework and .Net core ?

I use NEST 7.2.1, .Net standard library 2.0.3

```

**-- Exception --**

Elasticsearch.Net.ElasticsearchClientException  
HResult=0x80131500  
Message=scrolling search on /coint%2A/\_search?typed\_keys=true&scroll=5m with slice 0 was not valid on scroll iteration 0  
Source=Nest  
StackTrace:  
at Nest.BlockingSubscribeExtensions.WaitOnObservable[TObservable,TObserve,TObserver](TObservable observable, TimeSpan maximumRunTime, Func`3 factory) at Nest.BlockingSubscribeExtensions.Wait[T](IObservable`1 observable, TimeSpan maximumRunTime, Action`1 onNext)  
at Slb.Prism.DevTool.Library.RollupFlowCalls.Search.getList(ElasticClient esClient, String index, ILogger log) in D:\<blabla\>\DevTool.Service.ControlFlow\RollupFlowCalls\Search.cs:line 53  
at ConsoleTestCore.Program.Main(String args) in D:\<blabla\>\ControlFlow\ConsoleTestCore\Program.cs:line 15

**--- Code ---**

```
   public static List<Record> getList(ElasticClient esClient, string index, ILogger log)
    {
        if (log != null) log.LogInformation($"Entersearch");
        var seenDocuments = 0;
        var doccuments = new ConcurrentBag<IReadOnlyCollection<Source>>();
        DateTime gteTime = DateTime.Now.AddMinutes(-10);
        DateTime ltTime = DateTime.Now;
        List<Record> indexedList = new List<Record>();
        int para = 6;

        if (log != null) log.LogInformation($"Start search");
        esClient.ScrollAll<Source>("5m", para, s => s
        .MaxDegreeOfParallelism(para / 2)
        .Search(w => w
        .Index(index)
                        .Source(true)
                        .From(0)
                        .Size(500)
                        .Query(q => q
                            .Bool(b => b
                                .Filter(bf => bf
                                    .DateRange(dr => dr
                                       .Field(f => f.timestamp)
                                       .GreaterThanOrEquals(gteTime)
                                       .LessThan(ltTime)))
                                .Must(mu => mu
                                    .Match(ma => ma
                                        .Field(fi => fi.level)
                                        .Query("Stack")))))))
        .Wait(TimeSpan.FromMinutes(5), r =>
        {
            if (log != null) log.LogInformation($"In wait");
            doccuments.Add(r.SearchResponse.Documents);
            Interlocked.Add(ref seenDocuments, r.SearchResponse.Hits.Count);
        });
        if (log != null) log.LogInformation($"Out wait");
```

---

<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 23, 2019, 10:53pm UTC](https://discuss.elastic.co/t/scrollall-net-framework-versus-net-core/196847/2 "2019-09-23T22:53:36Z")

</div>

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