Title: "using assembly" can't find assembly in scriptdir on non-Windows because of bug in Parser.cs line:5136 · Issue #21161 · PowerShell/PowerShell · GitHub
Open Graph Title: "using assembly" can't find assembly in scriptdir on non-Windows because of bug in Parser.cs line:5136 · Issue #21161 · PowerShell/PowerShell
X Title: "using assembly" can't find assembly in scriptdir on non-Windows because of bug in Parser.cs line:5136 · Issue #21161 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/21161
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"using assembly\" can't find assembly in scriptdir on non-Windows because of bug in Parser.cs line:5136","articleBody":"### Prerequisites\r\n\r\n- [X] Write a descriptive title.\r\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- [X] Search the existing issues.\r\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\ncreate an assembly and run a script with the following content:\r\n```powershell\r\nusing assembly mydll.dll\r\n[mydll.mytype]\r\n```\r\n\r\n\r\n### Expected behavior\r\n\r\n```console\r\nno errors\r\n```\r\n\r\n\r\n### Actual behavior\r\n\r\n```console\r\nParserError: /Users/james/bin/testit.ps1:1\r\nLine |\r\n 1 | using assembly mydll.dll\r\n | ~~~~~~~~~~~~~~~~~~\r\n | Cannot load assembly 'mydll.dll'.\r\n```\r\n\r\n\r\n### Error details\r\n\r\nline 5136: \r\n\r\n`assemblyFileName = workingDirectory + @\"\\\" + assemblyFileName`\r\n\r\non a Unix System, `\\` is not a directory separator but a valid filename character.\r\n\r\nThe fix is:\r\n\r\n`assemblyFileName = Path.Combine(workingDirectory, assemblyFileName);`\r\n\r\n\r\n### Environment data\r\n\r\n```powershell\r\n\u003e $psversiontable\r\n\r\nName Value\r\n---- -----\r\nPSVersion 7.4.0\r\nPSEdition Core\r\nGitCommitId 7.4.0\r\nOS Darwin 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:28:58 PST 2023; root:xnu-10002.81.5~7/RELEASE_X86_64\r\nPlatform Unix\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\r\n### Visuals\r\n\r\n_No response_","author":{"url":"https://github.com/JamesWTruher","@type":"Person","name":"JamesWTruher"},"datePublished":"2024-01-31T00:06:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/21161/PowerShell/issues/21161"}
| 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:fe3c0433-d599-cbe8-d76a-7783ed035772 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DEFA:A5979:28EEE20:3AC63FC:6A56704B |
| html-safe-nonce | 59fe12eefcab0690837d342e0be1e3942755b265b30ce7e31d9ecbb2176fbacc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERUZBOkE1OTc5OjI4RUVFMjA6M0FDNjNGQzo2QTU2NzA0QiIsInZpc2l0b3JfaWQiOiI4MzU0MTc3NjQ1NTYzNzY4OTA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bde092d577657b2dc741def5f0277fc4eaa196d79be447a207f6cdcb994621eb |
| hovercard-subject-tag | issue:2109025696 |
| 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/21161/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e967e19afd0275a92d5040bf50cb75cbe5eab1093ff71e3ef529a742e567b4ac/PowerShell/PowerShell/issues/21161 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e967e19afd0275a92d5040bf50cb75cbe5eab1093ff71e3ef529a742e567b4ac/PowerShell/PowerShell/issues/21161 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JamesWTruher |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19b5ee9431dcfce15ab4b001d626e4e3a6ba1acb7be814813a52bbebd9a86ef5 |
| 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 | afc01ffdb045f4ff81c6122091366ade7b6166b7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width