# Is there a .NET client for VSCode?

**URL:** <https://discuss.elastic.co/t/is-there-a-net-client-for-vscode/284215>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 14, 2021, 6:39pm UTC](https://discuss.elastic.co/t/is-there-a-net-client-for-vscode/284215 "2021-09-14T18:39:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bensalerno](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bensalerno](https://discuss.elastic.co/u/bensalerno)\
**Post date:** [September 14, 2021, 6:39pm UTC](https://discuss.elastic.co/t/is-there-a-net-client-for-vscode/284215/1 "2021-09-14T18:39:03Z")

</div>

I am trying to create a file to write ElasticSearch queries from C#. I have seen that there is are 2 official ElasticSearch clients for .NET ([Introduction | Elasticsearch.Net and NEST: the .NET clients [7.x] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/introduction.html)) however these are made for Visual Studio. Is there a way to use these packages in VSCode? Or does there exist a similar package? Or are there any alternative ways to use ES API in C#?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [September 14, 2021, 9:40pm UTC](https://discuss.elastic.co/t/is-there-a-net-client-for-vscode/284215/2 "2021-09-14T21:40:20Z")

</div>

These are NuGet packages, you can install them using one of the methods available for [installing nuget packages](https://www.nuget.org/packages/Elasticsearch.Net).

You can also look for a VS Code Plugin to help you manage NuGet Packages.

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [September 15, 2021, 6:45am UTC](https://discuss.elastic.co/t/is-there-a-net-client-for-vscode/284215/3 "2021-09-15T06:45:21Z")

</div>

You can use the NuGet packages in VS code as @leandrojmp mentions. NuGet packages can be used anywhere that supports the NuGet package manager API.

To get started in VS Code, assuming you have

1. [a .NET SDK installed](https://dotnet.microsoft.com/download)
2. [the C# for Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp)

from the Terminal in VS Code

```auto
dotnet new console --name DotnetClientExample
cd DotnetClientExample

```

to create a new console application named DotnetClientExample and go to the project directory.

Then

```auto
dotnet add package Nest

```

to add the latest version of the Nest NuGet package to the project.

Then to use it, as an example, replace contents of Program.cs with

```auto
using System;
using Nest;

namespace DotnetClientExample
{
    class Program
    {
        static void Main(string[] args)
        {
            var client = new ElasticClient();
            var infoResponse = client.RootNodeInfo();
            Console.WriteLine($"cluster name is {infoResponse.ClusterName}");
        }
    }
}

```

which will print the name of the cluster at `http://localhost:9200`

---

<div class="post-metadata">

**Author:** ![bensalerno](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bensalerno](https://discuss.elastic.co/u/bensalerno)\
**Post date:** [September 15, 2021, 8:12pm UTC](https://discuss.elastic.co/t/is-there-a-net-client-for-vscode/284215/4 "2021-09-15T20:12:40Z")

</div>

Thank you very much

---

<div class="post-metadata">

**Author:** ![bensalerno](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bensalerno](https://discuss.elastic.co/u/bensalerno)\
**Post date:** [September 19, 2021, 10:55pm UTC](https://discuss.elastic.co/t/is-there-a-net-client-for-vscode/284215/5 "2021-09-19T22:55:22Z")

</div>

Could you take a look at this question for me? [Invalid NEST response built from a unsuccessful () low level call on POST using .NET Nest](https://discuss.elastic.co/t/invalid-nest-response-built-from-a-unsuccessful-low-level-call-on-post-using-net-nest/284583)

---

<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:** [October 17, 2021, 10:55pm UTC](https://discuss.elastic.co/t/is-there-a-net-client-for-vscode/284215/6 "2021-10-17T22:55:39Z")

</div>

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