I want to update an Azure CosmosDB Graph from Azure Functions with Gremlin.NET. I'm using 1.0.10 Functions Cli, .NET Framework 4.7.1 and a project with these dependencies:
<PackageReference Include="Gremlin.Net" Version="3.3.2" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DocumentDB" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="1.2.2-beta3" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.13" />
At submitting the query
var gremlinServer = new GremlinServer(
Settings.GraphEndPoint,
443,
enableSsl: true,
username: "/dbs/" + Settings.GraphDatabaseName + "/colls/" + Settings.GraphName,
password: Settings.GraphPrimaryKey);
using (var gremlinClient = new GremlinClient(gremlinServer, new GraphSON2Reader(), new GraphSON2Writer(), GremlinClient.GraphSON2MimeType))
{
var resultSet = await gremlinClient.SubmitAsync<dynamic>(graphStatement);
I run into this error:
Exception while executing function: GraphQuery. Gremlin.Net: Could not load file or assembly 'System.Reflection.TypeExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
NuGet dependencies diplay System.Reflection.TypeExtensions Version 4.3.0, file version seems to be 4.1.1.0.
What can I do to make it work?
Observation added:
When I clone, add Gremlin.NET csproj to my solution and reference it within the solution, I get the same error. However if I change Gremlin.NET Target framework from .NET Standard 1.3
to .NET Standard 2.0
I do not get this error. However then the communication with the Gremlin server breaks in Connection.ReceiveAsync
.
Migrated Function App with Gremlin.NET to Azure Functions v2 - the referencing problem does not occur here.
I have come across this issue, Ensure that you have the required version of the .NET Framework (4.5.1 or above)