Title: Loading Native Libraries is broken · Issue #9488 · PowerShell/PowerShell · GitHub
Open Graph Title: Loading Native Libraries is broken · Issue #9488 · PowerShell/PowerShell
X Title: Loading Native Libraries is broken · Issue #9488 · PowerShell/PowerShell
Description: Attempting to load a module that requires p/invoke from a third-party native library fails to load the library from the same folder as the DLL doing the p/invoking. This used to work in PowerShell Core 6.1.0 but regressed between 6.2.0-p...
Open Graph Description: Attempting to load a module that requires p/invoke from a third-party native library fails to load the library from the same folder as the DLL doing the p/invoking. This used to work in PowerShell ...
X Description: Attempting to load a module that requires p/invoke from a third-party native library fails to load the library from the same folder as the DLL doing the p/invoking. This used to work in PowerShell ...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/9488
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Loading Native Libraries is broken","articleBody":"Attempting to load a module that requires p/invoke from a third-party native library fails to load the library from the same folder as the DLL doing the p/invoking.\r\n\r\nThis _used to work_ in PowerShell Core 6.1.0 but regressed between 6.2.0-preview1 and 6.2.0-preview2. It still works in Windows PowerShell.\r\n\r\nThe native library it's failing to locate is located in the same folder as the SkiaSharp.dll that is trying to locate it. See https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-462362391 and that issue thread for why it was done in that fashion.\r\n\r\n# Steps to reproduce\r\n\r\n```powershell\r\nInstall-Module PSWordCloud\r\nNew-WordCloud\r\n```\r\n\r\n# Expected behavior\r\n\r\n```none\r\ncmdlet New-WordCloud at command pipeline position 1\r\nSupply values for the following parameters:\r\nInputObject:\r\n```\r\n\r\n# Actual behavior\r\n\r\n```none\r\nnew-wordcloud : The type initializer for 'PSWordCloud.WCUtils' threw an exception.\r\nAt line:1 char:1\r\n+ new-wordcloud\r\n+ ~~~~~~~~~~~~~\r\n+ CategoryInfo : NotSpecified: (:) [], TypeInitializationException\r\n+ FullyQualifiedErrorId : System.TypeInitializationException\r\n```\r\n\r\nQuerying for the base exception with `$Error[0].Exception.GetBaseException() | Format-List * -F` yields the following:\r\n\r\n```\r\nMessage : Unable to load DLL 'libSkiaSharp' or one of its dependencies: The specified module could not be\r\n found. (Exception from HRESULT: 0x8007007E)\r\nTypeName :\r\nData : {}\r\nInnerException :\r\nTargetSite : IntPtr sk_fontmgr_ref_default()\r\nStackTrace : at SkiaSharp.SkiaApi.sk_fontmgr_ref_default()\r\n at SkiaSharp.SKFontManager.get_Default()\r\n at PSWordCloud.WCUtils..cctor()\r\nHelpLink :\r\nSource : SkiaSharp\r\nHResult : -2146233052\r\n```\r\n\r\n# Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 6.2.0\r\nPSEdition Core\r\nGitCommitId 6.2.0\r\nOS Microsoft Windows 10.0.17763\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n\r\n_Note:_ The same was tested in a Mac environment (thanks @steviecoaster!) and also failed in the same way. I suspect it will be identical on Linux distros as well.\r\n\r\n/cc @SteveL-MSFT ","author":{"url":"https://github.com/vexx32","@type":"Person","name":"vexx32"},"datePublished":"2019-04-27T12:37:13Z","url":"https://github.com/PowerShell/PowerShell/issues/9488"}
| 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:8f0c0cbc-8987-dbf6-40b4-75cfcbe82cce |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 855C:1FA7D2:A2E82:DE0D2:6AFD4A17 |
| html-safe-nonce | 26f4a3a22d0ffa05bf603f11c0b06b85d5be63b5ce47cf4b20281f940e71f7e9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTVDOjFGQTdEMjpBMkU4MjpERTBEMjo2QUZENEExNyIsInZpc2l0b3JfaWQiOiI3OTc4NDQwOTM1NzE5Mzg5NzE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d7d64de9c7d2a62baf18bd26843f53936803827c2725142a97210f9d4cd4dad4 |
| hovercard-subject-tag | issue:437939422 |
| 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/PowerShell/PowerShell/9488/issue_layout |
| twitter:image | https://opengraph.githubassets.com/514986c867a2e32f5490790f5947a9ce0325fc63384b7565702cb69015a0b4ce/PowerShell/PowerShell/issues/9488 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/514986c867a2e32f5490790f5947a9ce0325fc63384b7565702cb69015a0b4ce/PowerShell/PowerShell/issues/9488 |
| og:image:alt | Attempting to load a module that requires p/invoke from a third-party native library fails to load the library from the same folder as the DLL doing the p/invoking. This used to work in PowerShell ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vexx32 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| 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 | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width