C
C#3y ago
Silme94

❔ System.Net.Http Not Found

while compiling ths file, i got an error that say that Http doesn't exist in the namespace System.Net Who can help me fix it?
using System;
using System.Net;
using System.Net.Http;

class Program{

HttpClient client = new HttpClient();
static void Main(string[] link){
foreach(string i in link){
Console.WriteLine(i);
}
}
}
using System;
using System.Net;
using System.Net.Http;

class Program{

HttpClient client = new HttpClient();
static void Main(string[] link){
foreach(string i in link){
Console.WriteLine(i);
}
}
}
10 Replies
Angius
Angius3y ago
"Compiling the file"? You mean you have a loose .cs file that you're trying to compile with csc or some such?
Silme94
Silme94OP3y ago
no its just meaning that i got an error
Angius
Angius3y ago
What version of .NET?
Silme94
Silme94OP3y ago
how i see that
Angius
Angius3y ago
In the .csproj file, for example
Silme94
Silme94OP3y ago
.csproj doesn't exist you mean file.csproj ?
Angius
Angius3y ago
Yes I just gave you the extension, since the name differs
Silme94
Silme94OP3y ago
Angius
Angius3y ago
Open this file, don't try to execute it You have your project open in your IDE. In the solution browser to the left (VS Code and Rider) or right (Visual Studio) you will see a green-ish icon that's a parent to all your files and is named like your project That's the .csproj file You can open it and you'll see the properties of it, in one way or another Or you can just navigate to it with file explorer, and open it in Notepad or whatever
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?