Questions tagged [system.net]

System.Net is a namespace of the .NET framework. It provides a simple programming interface for many of the protocols used on networks today.

System.Net is a namespace of the .NET framework. It provides a simple programming interface for many of the protocols used on networks today.

References

297 questions
7
votes
1 answer

How use BufferList with SocketAsyncEventArgs and not get SocketError InvalidArgument?

I can use SetBuffer with SocketAsyncEventArgs just fine. If I try to use BufferList (after doing SetBuffer(null, 0, 0)) I always and immediately get SocketError InvalidArgument (10022) when I do SendAsync on the socket. There are NO examples or…
Dave
  • 1,822
  • 2
  • 27
  • 36
6
votes
3 answers

Explain the instance properties of System.Net.IPAddress

I'm having a little trouble understanding the System.Net.IPAddress class, because I don't know where to look for a definition of what some of the properties are referring to. Specifically, what are: IPAddress.IsIPv6LinkLocal …
smartcaveman
  • 41,281
  • 29
  • 127
  • 212
6
votes
0 answers

Difference between reference and packagereference elements (c#)

I see that certain system packages (e.g. System.Net.Http) are referenced using PackageReference elements, while other are referenced using Reference elements. What is the difference between the two options? Are the two interchangeable? Which one is…
yuvalm2
  • 866
  • 2
  • 10
  • 27
6
votes
3 answers

Effect of System.Net Connection Management

Can someone tell me if this setting affects my WCF (basicHttpBinding) services?
sajidnizami
  • 467
  • 5
  • 15
6
votes
1 answer

Wrong version of System.Net.Http on build server

I came across this article yesterday because I wanted to implement attribute routing in my MVC project. http://www.asp.net/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2 So I went and updated as per the message from the…
Matt Canty
  • 2,395
  • 5
  • 35
  • 50
6
votes
1 answer

can't compile - Request.Content.IsMimeMultipartContent() not found

I have the following code: public class UploadController : ApiController { DBRepository _repository = new DBRepository(); public Task> Post() { string folderName = "UploadedFiles"; string PATH =…
Oleg Sh
  • 8,496
  • 17
  • 89
  • 159
6
votes
3 answers

Long time to load first connection in C# .NET

I'm making a program that connects to a website and downloads XML from it. It then displays the information to the user. The problem I am having is when I first open the program and start downloading the XML information it takes a really long time.…
Christian
  • 135
  • 2
  • 8
6
votes
2 answers

How to set a Host header value for SSL requests using HttpWebRequest

I am trying to use the System.Net.HttpWebRequest class to perform a HTTP GET request to a specific web server for web applications we have load balanced over numerous servers. In order to achieve this, I need to be able to set the Host header value…
Cleggy
  • 715
  • 9
  • 24
6
votes
1 answer

Web Api: System.Net.Http version 2.0.0.0 not found

When I install the NuGet package for WebApi, it gives me version 1.0.0.0 of System.Net.Http, yet it references version 2. I cannot seem to find version 2 for the life of me. When I download .net 4.5 I get System.Net.Http version 4.0.315.x, but I…
5
votes
1 answer

Disabling certificate validation for a single request

In my application I have situations in which I need to make a requests to servers that have self-signed certificates. I would like to be able to disable certificate validation only for that particular request. I know I can disable certificate…
Jim Scott
  • 2,493
  • 1
  • 18
  • 16
5
votes
5 answers

Non-Stop Exceptions in C#

I am writing some C# 2.0 code which must do basic HTTP GETs and POSTs. I am using System.Net.HttpWebRequest to send both types of request and System.Net.HttpWebResponse to receive both. My code for GET looks like: HttpWebRequest request =…
Aaron
  • 829
  • 6
  • 12
5
votes
1 answer

Using System.Net.Http.SocketsHttpHandler in .NET Core 2.1.0-rc1-final

.NET Core 2.1 comes with a great improvement on System.Net.HttpClient For HttpClient, we built a new from-the-ground-up managed HttpClientHandler called SocketHttpHandler. As you can likely guess, it’s a C# implementation of HttpClient based…
5
votes
1 answer

Serious CookieContainer bug?

Am I missing something here or is this a bug in the CookieContainer? I'm adding 3 cookies to the container and then I call the GetCookieHeader function for 2 urls: CookieContainer cc = new CookieContainer(); cc.Add(new Cookie("Cookie1", "1", "/a",…
srudin
  • 89
  • 4
5
votes
2 answers

Use App Pool Credentials to Send Email

We have an asp.net application that takes care of sending our in product emails. We would like to use the application pools account to send authenticated emails to our exchange server. Our web.config looks as follows:
badazzhindu
  • 913
  • 7
  • 21
5
votes
2 answers

System.Net.Mail reference does not exist

I have a problem creating application to send email. I already have one working as a Windows Forms Application and then decided to do the same from the empty project, because I need to make a background application now. I used the System.Net.Mail…
gthacoder
  • 2,213
  • 3
  • 15
  • 17
1 2
3
19 20