# OpenSearch.Net Method not found issue

**URL:** <https://forum.opensearch.org/t/opensearch-net-method-not-found-issue/14794>\
**Category:** OpenSearch Client Libraries\
**Tags:** clients-general, opensearch-net\
**Created:** [June 22, 2023, 12:21pm UTC](https://forum.opensearch.org/t/opensearch-net-method-not-found-issue/14794 "2023-06-22T12:21:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denied5](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/denied5/32/5682_2.png) [@Denied5](https://forum.opensearch.org/u/Denied5)\
**Post date:** [June 22, 2023, 12:21pm UTC](https://forum.opensearch.org/t/opensearch-net-method-not-found-issue/14794/1 "2023-06-22T12:21:49Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
Server: OpenSearch Version=“1.3”  
Client: .Net OpenSearch.Client Version=“1.3.0”  
.Net version: .Net 6.0

**Describe the issue** :  
Hi, I have faced issue while following the startup guide for [AWS SigV4 support for OpenSearch](https://opensearch.org/blog/aws-sigv4-support-for-clients/).

```auto
        Console.WriteLine("Os client");
        var connection = new AwsSigV4HttpConnection();
        var config = new ConnectionSettings(new SingleNodeConnectionPool(uri), connection)
            .DefaultIndex("people")
            .DisableDirectStreaming();
        var client = new OpenSearchClient(config);

        Console.WriteLine("Start requests");
        var response = client.Index(person, i => i.Index("persons"));

```

On client.Index() line i receive this error:

```auto
Method not found: 'System.String Amazon.Util.AWSSDKUtils.CanonicalizeResourcePathV2(System.Uri, System.String, Boolean, System.Collections.Generic.IDictionary`2<System.String,System.String>)'.

```

I have tried to change versions of OpenSearch.Client and OpenSearch.Net.Auth.AwsSigV4 but it didn’t fix the issue.

**Configuration** :  
I’m running this code in AWS Lambda with such packages:

```auto
<ItemGroup>
    <PackageReference Include="Amazon.Lambda.Core" Version="2.1.0" />
    <PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.3.1" />
    <PackageReference Include="OpenSearch.Client" Version="1.3.0" />
    <PackageReference Include="OpenSearch.Net.Auth.AwsSigV4" Version="1.3.0" />
  </ItemGroup>

```

**Relevant Logs or Screenshots** :  
Error log:

```auto
	OpenSearch.Net.UnexpectedOpenSearchClientException: Method not found: 'System.String Amazon.Util.AWSSDKUtils.CanonicalizeResourcePathV2(System.Uri, System.String, Boolean, System.Collections.Generic.IDictionary`2<System.String,System.String>)'.
 ---> System.MissingMethodException: Method not found: 'System.String Amazon.Util.AWSSDKUtils.CanonicalizeResourcePathV2(System.Uri, System.String, Boolean, System.Collections.Generic.IDictionary`2<System.String,System.String>)'.
   at OpenSearch.Net.Auth.AwsSigV4.CanonicalRequest.From(HttpRequestMessage request, ImmutableCredentials credentials, DateTime signingTime)
   at OpenSearch.Net.Auth.AwsSigV4.AwsSigV4Util.SignRequest(HttpRequestMessage request, ImmutableCredentials credentials, RegionEndpoint region, DateTime signingTime, String service)
   at OpenSearch.Net.Auth.AwsSigV4.AwsSigV4HttpClientHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)

```

(i can add full log on request)

---

<div class="post-metadata">

**Author:** ![xtansia](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/xtansia/32/4961_2.png) [@xtansia](https://forum.opensearch.org/u/xtansia)\
**Post date:** [June 22, 2023, 9:33pm UTC](https://forum.opensearch.org/t/opensearch-net-method-not-found-issue/14794/2 "2023-06-22T21:33:48Z")

</div>

Hi @Denied5,

This error would generally be caused by an old AWSSDK.Core version being pulled in but I don’t immediately see why that would happen with the dependencies you have listed. Would you be able to please run `dotnet list package --include-transitive` from within your project that is being deployed to Lambda and copy the output here?

Please also verify that the artifact being deployed contains `AWSSDK.Core.dll`.

Further, if possible, a complete minimal reproducing project would be helpful for understanding.

Thanks!

---

<div class="post-metadata">

**Author:** ![Denied5](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/denied5/32/5682_2.png) [@Denied5](https://forum.opensearch.org/u/Denied5)\
**Post date:** [June 23, 2023, 7:28am UTC](https://forum.opensearch.org/t/opensearch-net-method-not-found-issue/14794/3 "2023-06-23T07:28:41Z")

</div>

Hi @xtansia, thanks for your help!

Project ‘\*\*\*’ has the following package references  
[net6.0]:  
Top-level Package Requested Resolved

> Amazon.Lambda.Core 2.1.0 2.1.0  
> Amazon.Lambda.Serialization.SystemTextJson 2.3.1 2.3.1  
> AWSSDK.SecurityToken 3.7.103.16 3.7.103.16  
> OpenSearch.Client 1.3.0 1.3.0  
> OpenSearch.Net.Auth.AwsSigV4 1.3.0 1.3.0

Transitive Package Resolved

> AWSSDK.Core 3.7.107.8  
> Microsoft.CSharp 4.6.0  
> [OpenSearch.Net](http://OpenSearch.Net) 1.3.0  
> System.Buffers 4.5.1  
> System.Diagnostics.DiagnosticSource 6.0.0  
> System.Runtime.CompilerServices.Unsafe 6.0.0

During lambda deployment i can notice `AWSSDK.Core.dll` in dependencies:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/5/5940282a9d838d6244a95cea5102765f4520725c.png)

---

<div class="post-metadata">

**Author:** ![Denied5](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/denied5/32/5682_2.png) [@Denied5](https://forum.opensearch.org/u/Denied5)\
**Post date:** [June 23, 2023, 11:46am UTC](https://forum.opensearch.org/t/opensearch-net-method-not-found-issue/14794/4 "2023-06-23T11:46:32Z")

</div>

The problem was in how lambda tool works with nugets. Previously I experimented with a newer version of a nuget package and it was saved in a bin folder, Lambda tool collects the latest versions of packages from bin folder.  
So for me solution was to remove bin and obj folders and publish lambda again

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [August 22, 2023, 11:47am UTC](https://forum.opensearch.org/t/opensearch-net-method-not-found-issue/14794/5 "2023-08-22T11:47:18Z")

</div>

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