Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load assembly 'System.Net.Http' #1348

Open
droyad opened this issue Nov 27, 2023 · 3 comments
Open

Cannot load assembly 'System.Net.Http' #1348

droyad opened this issue Nov 27, 2023 · 3 comments

Comments

@droyad
Copy link

droyad commented Nov 27, 2023

When run, the following error occurs

ParserError: C:\Users\rober\AppData\Local\Temp\install.ps1:1
Line |
   1 |  using assembly System.Net.Http
     |                 ~~~~~~~~~~~~~~~
     | Cannot load assembly 'System.Net.Http'.

Removing the first line of the script makes it run.

@droyad
Copy link
Author

droyad commented Nov 27, 2023

Looks like it works fine on the Powershell 5 (the non-core version).

Even after the above change it failed due to the arguments passed to msiexec being invalid.

@ccressent
Copy link
Contributor

System.Net.Http is definitely needed by the script, so even if it goes further when removing the using statement, you're bound to run into issues.

What platform were you on when you came across this issue? I've seen it before while using PowerShell on Linux.

@droyad
Copy link
Author

droyad commented Jan 11, 2024

Here is the output from $PSVersionTable. I think it's because it uses .NET Core instead of .NET Framework

Name                           Value
----                           -----
PSVersion                      7.3.10
PSEdition                      Core
GitCommitId                    7.3.10
OS                             Microsoft Windows 10.0.22635
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants