mongodb-labs / mongo-csharp-search

C# driver extension providing support for Atlas Search
Apache License 2.0
17 stars 1 forks source link

Does not work with MongoDB.Driver 2.14.1 #6

Closed christosk92 closed 2 years ago

christosk92 commented 2 years ago

With mongoDB.Driver 2.14.1, the extension does not seem to be working. Using the code snippet from the README, the following error occurs (which does not occur when downgrading back to 2.13):

System.TypeLoadException: Method 'Render' in type 'MongoDB.Labs.Search.DelegatedPipelineStageDefinition`2' from assembly 'MongoDB.Labs.Search, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at MongoDB.Labs.Search.PipelineStageDefinitionBuilder.Search[TInput](SearchDefinition`1 query, HighlightOptions`1 highlight)
   at MongoDB.Labs.Search.AggregateFluentBuilder.Search[TResult](IAggregateFluent`1 aggregate, SearchDefinition`1 query, HighlightOptions`1 highlight)
   at MedialocManagmentApi.Repositories.ShowRepository.SearchSummaryAsync(String query, Nullable`1 skip, Nullable`1 take) in C:\Users\ckara\Documenten\medialoc-managmentapi\src\MedialocManagmentApi\Repositories\ShowRepository.cs:line 27
   at MedialocManagmentApi.Controllers.SearchController.SearchQuick(String query) in C:\Users\ckara\Documenten\medialoc-managmentapi\src\MedialocManagmentApi\Controllers\SearchController.cs:line 29
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

HEADERS
=======
Accept: */*
Connection: keep-alive
Host: localhost:7214
User-Agent: PostmanRuntime/7.28.4
Accept-Encoding: gzip, deflate, br
Postman-Token: 446e3397-5a70-40f3-ae86-2d413095ba69
dgolub commented 2 years ago

Fixed and will be included in the forthcoming Beta 2: https://github.com/mongodb-labs/mongo-csharp-search/commit/bd7d22c84c0a15d7fa585e117305ea435b5ecbe1

dgolub commented 2 years ago

Beta 2 has now been released: https://www.nuget.org/packages/MongoDB.Labs.Search/1.0.0-beta2

You should be able to resolve this issue by upgrading. Thank you very much for the bug report.