© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
86 replies
Exilon

Custom cmdlet giving me a missing assembly error

Powershell gives me this error when I try run my cmdlet:
Get-UserFromId: Could not load file or assembly 'System.Net.Http.Formatting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Get-UserFromId: Could not load file or assembly 'System.Net.Http.Formatting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

I'm using this guide to make API calls through this tutorial: https://stackoverflow.com/questions/9620278/how-do-i-make-calls-to-a-rest-api-using-c

which told me to add that assembly. When I compile it and use
ipmo
ipmo
to add it to my powershell, I get that error when trying to run it. I was required to reference
System.Net.Http.Formatting
System.Net.Http.Formatting
to get
ReadAsAsync<>()
ReadAsAsync<>()
to work (I think). Am I just building my project wrong?
Stack Overflow
How do I make calls to a REST API using C#?
This is the code I have so far:
public class Class1
{
private const string URL = "https://sub.domain.com/objects.json?api_key=123";
private const string DATA = @&q...
How do I make calls to a REST API using C#?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

Attempt to start new PowerShell Cmdlet assembly fails with PSNotSupportedException
C#CC# / help
3w ago
❔ Missing assembly reference using PackageReference
C#CC# / help
3y ago
Why is docfx giving me a recursion error?
C#CC# / help
2y ago
Error with assembly
C#CC# / help
2y ago