Title: Make location native binary configurable · Issue #515 · libgit2/libgit2sharp · GitHub
Open Graph Title: Make location native binary configurable · Issue #515 · libgit2/libgit2sharp
X Title: Make location native binary configurable · Issue #515 · libgit2/libgit2sharp
Description: When using libgit2sharp from within LinqPad via NuGet, loading the native binary does not work as intended. The executing assembly usually lies somewhere "AppData\Local\Temp\LINQPad\whatever" while all referenced libraries lie elsewhere....
Open Graph Description: When using libgit2sharp from within LinqPad via NuGet, loading the native binary does not work as intended. The executing assembly usually lies somewhere "AppData\Local\Temp\LINQPad\whatever" while...
X Description: When using libgit2sharp from within LinqPad via NuGet, loading the native binary does not work as intended. The executing assembly usually lies somewhere "AppData\Local\Temp\LINQPad\whatever&q...
Opengraph URL: https://github.com/libgit2/libgit2sharp/issues/515
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make location native binary configurable","articleBody":"When using libgit2sharp from within LinqPad via NuGet, loading the native binary does not work as intended. The executing assembly usually lies somewhere \"AppData\\Local\\Temp\\LINQPad\\whatever\" while all referenced libraries lie elsewhere. CodeBase seems unset for the executing assembly. Thus the type initializer of NativeMethods fails put the correct location into the path:\n\n``` csharp\n static NativeMethods()\n {\n if (!IsRunningOnLinux())\n {\n string originalAssemblypath = new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath;\n\n string currentArchSubPath = \"NativeBinaries/\" + ProcessorArchitecture;\n\n string path = Path.Combine(Path.GetDirectoryName(originalAssemblypath), currentArchSubPath);\n\n const string pathEnvVariable = \"PATH\";\n Environment.SetEnvironmentVariable(pathEnvVariable,\n String.Format(CultureInfo.InvariantCulture, \"{0}{1}{2}\", path, Path.PathSeparator, Environment.GetEnvironmentVariable(pathEnvVariable)));\n }\n\n // See LibraryLifetimeObject description.\n lifetimeObject = new LibraryLifetimeObject();\n }\n```\n\nA workaround is to add the correct path with EnvironMent.SetEnvironmentVariable at application start/composition root which seems a bit odd as it may break when updateing via nuget once again (see: http://stackoverflow.com/a/18867945/303290 ).\n","author":{"url":"https://github.com/embix","@type":"Person","name":"embix"},"datePublished":"2013-09-18T09:22:05Z","url":"https://github.com/libgit2/libgit2sharp/issues/515"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4e93ebff-86b7-db09-6c7f-3fd527b6aa8e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C490:2EC689:2C0C947:3C1F437:6B005978 |
| html-safe-nonce | 00213274f03fd54fcb41c1d8f6e9bfaf676bf6b3d3bf0c2c7cbc48c44307b571 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDkwOjJFQzY4OToyQzBDOTQ3OjNDMUY0Mzc6NkIwMDU5NzgiLCJ2aXNpdG9yX2lkIjoiODgwODQxMzY2NTk3MjczODQyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b16dc39846a4fc9716fed9477077d5093253e5b162552885946b48828f014537 |
| hovercard-subject-tag | issue:19669941 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/libgit2/libgit2sharp/515/issue_layout |
| twitter:image | https://opengraph.githubassets.com/956d2c096f15b970e159933ae839827b841939841cc9b766a73bac87f9797469/libgit2/libgit2sharp/issues/515 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/956d2c096f15b970e159933ae839827b841939841cc9b766a73bac87f9797469/libgit2/libgit2sharp/issues/515 |
| og:image:alt | When using libgit2sharp from within LinqPad via NuGet, loading the native binary does not work as intended. The executing assembly usually lies somewhere "AppData\Local\Temp\LINQPad\whatever" while... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | embix |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| turbo-cache-control | no-preview |
| go-import | github.com/libgit2/libgit2sharp git https://github.com/libgit2/libgit2sharp.git |
| octolytics-dimension-user_id | 394745 |
| octolytics-dimension-user_login | libgit2 |
| octolytics-dimension-repository_id | 1415168 |
| octolytics-dimension-repository_nwo | libgit2/libgit2sharp |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1415168 |
| octolytics-dimension-repository_network_root_nwo | libgit2/libgit2sharp |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width