Title: scriptcs + libgit2sharp -> Unable to load DLL 'git2' · Issue #431 · libgit2/libgit2sharp · GitHub
Open Graph Title: scriptcs + libgit2sharp -> Unable to load DLL 'git2' · Issue #431 · libgit2/libgit2sharp
X Title: scriptcs + libgit2sharp -> Unable to load DLL 'git2' · Issue #431 · libgit2/libgit2sharp
Description: If someone wants to jump on this, the current way of "including" git2.dll doesn't work when you try and reference it inside a scriptcs script. Repro: https://github.com/aaronpowell/scriptcs-git Script: using System; using LibGit2Sharp; s...
Open Graph Description: If someone wants to jump on this, the current way of "including" git2.dll doesn't work when you try and reference it inside a scriptcs script. Repro: https://github.com/aaronpowell/scriptcs-git Scr...
X Description: If someone wants to jump on this, the current way of "including" git2.dll doesn't work when you try and reference it inside a scriptcs script. Repro: https://github.com/aaronpowell/sc...
Mail addresses
notifications@github.com
libgit2sharp@noreply.github.com
notifications@github.comwrote
notifications@github.com
libgit2sharp@noreply.github.com
Opengraph URL: https://github.com/libgit2/libgit2sharp/issues/431
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"scriptcs + libgit2sharp -> Unable to load DLL 'git2' ","articleBody":"If someone wants to jump on this, the current way of \"including\" git2.dll doesn't work when you try and reference it inside a scriptcs script.\n\nRepro: https://github.com/aaronpowell/scriptcs-git\n\nScript:\n\n```\nusing System;\nusing LibGit2Sharp;\n\nstatic Repository InitOrOpen(string path)\n{\n var gitBasePath = Repository.Discover(path);\n if (gitBasePath == null)\n {\n Console.WriteLine(\"And we're creating a new git repo people!\");\n return Repository.Init(path);\n }\n Console.WriteLine(\"Found existing repo, keep on trucking\");\n return new Repository(gitBasePath);\n}\n\nusing (var repo = InitOrOpen(@\"C:\\temp\\git-fun\\out\"))\n{\n Console.WriteLine(\"It's time to rock and rooooooooll\");\n}\n\nConsole.ReadLine();\n```\n\nThen, in the directory containing this script:\n\n```\nscriptcs -install\nscriptcs .\\app.csx -debug\n```\n\nWhich gives this output:\n\n```\nINFO : Starting to create execution components\nINFO : Starting execution\nERROR: An error occurred when executing the scripts.\nERROR: Exception Message: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.\nStack Trace: at LibGit2Sharp.Core.NativeMethods.git_repository_discover(Byte[] repository_path, UIntPtr size, FilePath start_path, Boolean across_fs, FilePath ceiling_dirs)\n at LibGit2Sharp.Core.Proxy.\u003c>c__DisplayClass1f.\u003cgit_repository_discover>b__1e(Byte[] buffer, UIntPtr bufSize)\n at LibGit2Sharp.Core.Proxy.ConvertPath(Func`3 pathRetriever)\n at LibGit2Sharp.Repository.Discover(String startingPath)\n at Submission#0..ctor(Session session, Object& submissionResult) in D:\\Code\\github\\aaronpowell\\scriptcs-git\\.\\app.csx:line 16\n at Submission#0.\u003cFactory>(Session session)\n\nUnhandled Exception: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'git2': The specified module could not be found. (Exception from HRESULT: 0x8007007E)\n at LibGit2Sharp.Core.NativeMethods.git_threads_init()\n at LibGit2Sharp.Core.NativeMethods.LibraryLifetimeObject..ctor()\n at LibGit2Sharp.Core.NativeMethods..cctor()\n --- End of inner exception stack trace ---\n at LibGit2Sharp.Core.NativeMethods.RemoveHandle()\n at LibGit2Sharp.Core.NativeMethods.LibraryLifetimeObject.Finalize()\n```\n\nI don't expect the scriptcs guys to support PostBuildEvent like Visual Studio does, so I'm curious what our options might be for \"really important stuff you need to do after installing a package\" which seems to be the last opportunity to do that before scriptcs starts loading in assemblies.\n\ncc @glennblock @aaronpowell\n","author":{"url":"https://github.com/shiftkey","@type":"Person","name":"shiftkey"},"datePublished":"2013-05-13T03:09:43Z","url":"https://github.com/libgit2/libgit2sharp/issues/431"}
| 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:275baf14-3bf6-0908-dc94-2c6397dd41b5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8FD0:1F52F6:CE305A:114EA1A:6B005328 |
| html-safe-nonce | 4b13f0a2b0ad2b11aa0fafca8747b3ea4354925f9845fd149e6fb92b572a9d6c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkQwOjFGNTJGNjpDRTMwNUE6MTE0RUExQTo2QjAwNTMyOCIsInZpc2l0b3JfaWQiOiI0NzIwNDY4NjY0MTMyODUwNDcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c2388c35c061dab2471cbe5d101462bb07c02a2b98b0bab5295c1cba193eac37 |
| hovercard-subject-tag | issue:14244214 |
| 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/431/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fbedba814f13b8d406c5298fdd09246ec64c7bd5da1d0f9bacf644186626c0ae/libgit2/libgit2sharp/issues/431 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fbedba814f13b8d406c5298fdd09246ec64c7bd5da1d0f9bacf644186626c0ae/libgit2/libgit2sharp/issues/431 |
| og:image:alt | If someone wants to jump on this, the current way of "including" git2.dll doesn't work when you try and reference it inside a scriptcs script. Repro: https://github.com/aaronpowell/scriptcs-git Scr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shiftkey |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| 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 | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width