Daniel C. Weber created TINKERPOP-2918:
------------------------------------------

             Summary: Utils.GenerateUserAgent assumes Gremlin.Net.dll to be 
present when, in some environments, it is not.
                 Key: TINKERPOP-2918
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2918
             Project: TinkerPop
          Issue Type: Bug
          Components: dotnet
    Affects Versions: 3.6.2
            Reporter: Daniel C. Weber


The dotnet driver in v3.6.2 adds the ability to add a user agent to the request.

To get the user agent name,  Gremlin.Net.Process.Utils.GenerateUserAgent uses 
AssemblyName.GetAssemblyName("Gremlin.Net.dll") to access the underlying (see 
[here|https://github.com/apache/tinkerpop/blob/125e5bf4560546c9727dd25ff4d590f34c7d625b/gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs#L81])

Because the dll is referenced in a relative manner, in some environments 
(Visual studio debugging and Docker deployment for me), this results in a 
FileNotFoundException. In my specific local case, the path prefixed is the path 
where the csproj is.

However, it works in a different project (also VS locally). I have no idea yet 
why. Also, I would file a pull request that would just use 
GetExecutingAssembly() instead of  AssemblyName.GetAssemblyName (because the 
executing code is in that specific dll), but there's probably a reason for it 
not being used. Then again, using GetExecutingAssembly for the application name 
seems odd, was that supposed to be GetEntryAssembly?

Will happily provide more insight and code.

[~Florian Hockmann]







--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to