# Not entry point found tiledb\_query\_get\_field C#

**URL:** <https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663>\
**Category:** Uncategorized\
**Created:** [March 7, 2024, 10:46pm UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663 "2024-03-07T22:46:10Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![kunaal\_desai](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/kunaal_desai/32/323_2.png) [@kunaal\_desai](https://forum.tiledb.com/u/kunaal_desai)\
**Post date:** [March 7, 2024, 10:46pm UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/1 "2024-03-07T22:46:10Z")

</div>

I have some C# code which looks like following

//Create array

> public void CreateArray(string uri, ArrayDimension rowDimension, ArrayDimension columnDimension)  
> {  
> try  
> {  
> using (var ctx = new Context())  
> {  
> var domain = new Domain(ctx);  
> domain.AddDimensions(  
> Dimension.Create(ctx, “rows”, rowDimension.Start, rowDimension.End, rowDimension.TileExtent),  
> Dimension.Create(ctx, “cols”, columnDimension.Start, columnDimension.End, columnDimension.TileExtent)  
> );
> 
> ```
> // The array will be dense.
> var schema = new ArraySchema(ctx, ArrayType.Dense);
> schema.SetDomain(domain);
>   
> var xNorm = new TileDB.CSharp.Attribute(ctx, "x_norm", DataType.Float64);
> var yNorm = new TileDB.CSharp.Attribute(ctx, "y_norm", DataType.Float64);
>   
> schema.AddAttributes(xNorm, yNorm);
> Array.Create(ctx,uri,schema);
> }
> }
> catch (Exception e)
> {
> Console.WriteLine(e);
> throw;
> }
> 
> }
> 
> ```

and then write to the array using following code:

> public void WriteArrayFloat(string arrayName, List xNorm, List yNorm, int index, int size)  
> {  
> try  
> {  
> using var ctx = new Context();  
> using (var array = new Array(ctx, arrayName))  
> {  
> array.Open(QueryType.Write);  
> using Subarray subArray = new Subarray(array);  
> subArray.SetSubarray(index, index, 1, size);  
> using (var query = new Query(ctx, array, QueryType.Write))  
> {  
> query.SetLayout(LayoutType.RowMajor);  
> query.SetDataBuffer(“x\_norm”, xNorm.ToArray());  
> query.SetDataBuffer(“y\_norm”, yNorm.ToArray());  
> query.SetSubarray(subArray);
> 
> ```
> Console.WriteLine("Writing started");
> // Perform the write and close the array.
> query.Submit();
> array.Close();
> }
> }
> Console.WriteLine("Writing done!!");
> }
> catch (Exception e)
> {
> Console.WriteLine(e);
> throw;
> }
> 
> }
> 
> ```

when it tries to setBuffer, it throws the following error:

not entry point found tiledb\_query\_get\_field tiledb Why idea why? I am using Tiledb.Csharp 5.10.0

---

<div class="post-metadata">

**Author:** ![teo-tsirpanis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/teo-tsirpanis/32/324_2.png) [@teo-tsirpanis](https://forum.tiledb.com/u/teo-tsirpanis)\
**Post date:** [March 8, 2024, 12:20am UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/2 "2024-03-08T00:20:29Z")

</div>

Hello @kunaal_desai. I tried reproducing the issue by running a program similar to yours but failed.

Under normal circumstances, the native TileDB library is downloaded from NuGet but the error message you encountered indicates that it did not happen, and a mismatched version of TileDB got picked from somewhere else. Could you add a `Console.WriteLine($"Using TileDB {CoreUtil.GetCoreLibVersion()}");` in your program and tell me the result?

Furthermore, in order for NuGet to download the binaries for the correct platform, you should be specifying [a runtime identifier](https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#runtimeidentifier) when building (if you don’t you should be getting a warning). Are you doing that, and if not, are you getting a warning?

Could you also tell me more about your environment? What is the operating system and .NET version that you are using?

Thanks

---

<div class="post-metadata">

**Author:** ![kunaal\_desai](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/kunaal_desai/32/323_2.png) [@kunaal\_desai](https://forum.tiledb.com/u/kunaal_desai)\
**Post date:** [March 8, 2024, 1:04am UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/3 "2024-03-08T01:04:01Z")

</div>

The console.writeline has a result:

Using TileDB 2.15.0

The only warning that I see when I build is

warning : The TileDB native library will be imported only when performing an RID-specific build. See the README of the TileDB.CSharp package for more information.

I also added the following code to my .csproj

```auto
<PropertyGroup>
		<RuntimeIdentifier>osx-x64</RuntimeIdentifier>
	</PropertyGroup>

```

I also have following packages referenced.

```auto
<PackageReference Include="TileDB.CSharp" Version="5.10.0" />
	  <PackageReference Include="TileDB.Native" Version="2.20.0" />

```

---

<div class="post-metadata">

**Author:** ![kunaal\_desai](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/kunaal_desai/32/323_2.png) [@kunaal\_desai](https://forum.tiledb.com/u/kunaal_desai)\
**Post date:** [March 8, 2024, 1:14am UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/4 "2024-03-08T01:14:32Z")

</div>

One. a side note, I have brew installed tile-db on the machine. Could that version be in conflict with this version? How is it related with the package Tiledb.csharp?

---

<div class="post-metadata">

**Author:** ![teo-tsirpanis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/teo-tsirpanis/32/324_2.png) [@teo-tsirpanis](https://forum.tiledb.com/u/teo-tsirpanis)\
**Post date:** [March 8, 2024, 1:19am UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/5 "2024-03-08T01:19:35Z")

</div>

The TileDB Homebrew packages are [deprecated since version 2.15](https://github.com/TileDB-Inc/homebrew-stable#install-tiledb-from-brew). I suggest you uninstall it and try again.

---

<div class="post-metadata">

**Author:** ![kunaal\_desai](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/kunaal_desai/32/323_2.png) [@kunaal\_desai](https://forum.tiledb.com/u/kunaal_desai)\
**Post date:** [March 8, 2024, 4:19am UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/6 "2024-03-08T04:19:27Z")

</div>

What package should my tile-db be?

---

<div class="post-metadata">

**Author:** ![teo-tsirpanis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/teo-tsirpanis/32/324_2.png) [@teo-tsirpanis](https://forum.tiledb.com/u/teo-tsirpanis)\
**Post date:** [March 8, 2024, 11:36am UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/7 "2024-03-08T11:36:17Z")

</div>

> What package should my tile-db be?

For C#, TileDB will be downloaded with the `TileDB.Native` NuGet package. Other languages have their own mechanism of acquiring TileDB (such as Conda or pip for Python).

---

<div class="post-metadata">

**Author:** ![kunaal\_desai](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/kunaal_desai/32/323_2.png) [@kunaal\_desai](https://forum.tiledb.com/u/kunaal_desai)\
**Post date:** [March 8, 2024, 11:33pm UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/8 "2024-03-08T23:33:58Z")

</div>

Thank you. It worked. I really appreciate your help. On a side note, I am trying to port some of the c++ code to C# and I was already expecting some lag but what I saw was a Huge difference in performance. Is this expected?

---

<div class="post-metadata">

**Author:** ![ihnorton](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/ihnorton/32/23_2.png) [@ihnorton](https://forum.tiledb.com/u/ihnorton)\
**Post date:** [March 11, 2024, 2:29am UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/9 "2024-03-11T02:29:32Z")

</div>

Hi @kunaal_desai, if you are specifically comparing usage of the TileDB C++ API vs equivalent usage of the TileDB C# API, then could you please share a minimal, non-proprietary reproduction? (both original C++, and comparable C#).

---

<div class="post-metadata">

**Author:** ![kunaal\_desai](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/kunaal_desai/32/323_2.png) [@kunaal\_desai](https://forum.tiledb.com/u/kunaal_desai)\
**Post date:** [March 11, 2024, 4:47am UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/10 "2024-03-11T04:47:53Z")

</div>

Do you want me to post it here or on a new thread?

---

<div class="post-metadata">

**Author:** ![kunaal\_desai](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/kunaal_desai/32/323_2.png) [@kunaal\_desai](https://forum.tiledb.com/u/kunaal_desai)\
**Post date:** [March 11, 2024, 5:03am UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/11 "2024-03-11T05:03:27Z")

</div>

When I call this c++ code from my C# adapter:

```auto
void write_array_float(char* array_name,
                    std::vector<float> x_norm,std::vector<float> y_norm,
                    int index, int size) {
    Context ctx;
    unsigned int microseconds;
   std::cout<< "The first element being written in tiledb.h is " + std::to_string(x_norm[0]) << std::endl;
   std::vector<int> subarray = {index, index, 1 ,size};

    // Open the array for writing and create the query.
    Array array(ctx, array_name, TILEDB_WRITE);
    Query query(ctx, array, TILEDB_WRITE);

     query.set_layout(TILEDB_ROW_MAJOR)
           .set_buffer("x_norm", x_norm)
           .set_buffer("y_norm", y_norm)
           .set_subarray(subarray);

      std::cout<<"Writting started" << std::endl;
    // Perform the write and close the array.
      query.submit();
      array.close();
      std::cout<<"Writting done!!" << std::endl;
}

```

However, when I translated this code into a C# code:

```auto
public void WriteArrayFloat(string arrayName, List<float> xNorm, List<float> yNorm, int index, int size)
    {
	    try
	    {
		    using var ctx = new Context();
		    using (var array = new Array(ctx, arrayName))
		    {
			    array.Open(QueryType.Write);
			    using Subarray subArray = new Subarray(array);
			    subArray.SetSubarray(index, index, 1, size);
			    using (var query = new Query(ctx, array, QueryType.Write))
			    {
				    query.SetLayout(LayoutType.RowMajor);
				    query.SetDataBuffer("x_norm", xNorm.ToArray());
				    query.SetDataBuffer("y_norm", yNorm.ToArray());
				    query.SetSubarray(subArray);

				    Console.WriteLine("Writing started");
				    // Perform the write and close the array.
				    query.Submit();
				    array.Close();
			    }
		    }
		    Console.WriteLine("Writing done!!");
	    }
	    catch (Exception e)
	    {
		    Console.WriteLine(e);
		    throw;
	    }

    }

```

This one is pretty slow. And just for some context, the difference is the magnitude of the difference. I can post more code if needed.

---

<div class="post-metadata">

**Author:** ![ihnorton](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/ihnorton/32/23_2.png) [@ihnorton](https://forum.tiledb.com/u/ihnorton)\
**Post date:** [March 11, 2024, 11:57am UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/12 "2024-03-11T11:57:31Z")

</div>

Thanks - if you can post a complete example that will definitely save us some time (build files etc.). Maybe a new github repo and share?

---

<div class="post-metadata">

**Author:** ![kunaal\_desai](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/kunaal_desai/32/323_2.png) [@kunaal\_desai](https://forum.tiledb.com/u/kunaal_desai)\
**Post date:** [March 12, 2024, 4:14am UTC](https://forum.tiledb.com/t/not-entry-point-found-tiledb-query-get-field-c/663/13 "2024-03-12T04:14:08Z")

</div>

I think I found the issue. The issue was with my tile configuration of tile-element. While porting the code from C++ to C#, I by mistake, changed the tile-element configuration and that caused the issue with the writing speed. The issue is resolved now.
