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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
26 views

Attaching a attachment to a calendar event using powershell

I am creating a calendar event using powershell. Ideally, I'd like to avoid using modules if possible because I feel like what I'm trying to do is very possible with what I have, but if a module is my ...
Koobah84's user avatar
  • 185
0 votes
1 answer
54 views

Don't allow parallel API invocation based on parameter

I'm required to do not allow more than one invocation at a time for an API, based on single query param. Parallel invocation with different values of the query param must be allowed. I invoke the api ...
GIovanni's user avatar
0 votes
1 answer
80 views

intellij IDEA + System.Net.Http.Formatting + issue to run function CLI command from staging folder

I am working with Azure Functions app in intellij idea. From Yesterday I am struggling with following issue : [2023-10-05T12:18:02.170Z] A host error has occurred during startup operation '7ab97efe-...
Neelam Sharma's user avatar
0 votes
0 answers
50 views

Access csv data from internet with c# and System.Net.Http

I am trying to download historical time series from Yahoo! Finance (I have the same issue with other sites). I have embedded the url address in a function to get a csv file. I am using System.Net and ...
Douar Gwenn's user avatar
0 votes
0 answers
36 views

ServicePointManager not initialised when in CLR class library?

I've inherited a CLR class library (.NET Framework 4.7.2) that provides a function which queries table storage in Azure. The function, called from a native C++ executable, is currently failing because ...
Eleco Martin's user avatar
0 votes
0 answers
35 views

How to manage packets in a custom server

Context: I want to make a multiplayer game with unity and i would like to make dedicated servers for players to be able to open their own server. I haven't made the game yet, i'm just experimenting ...
Zartox29's user avatar
0 votes
0 answers
72 views

Why am I getting 'Authentication required' error when sending email in Android .NET MAUI?

I am having this error when sending an email from the android App in .Net MAUI Version 6.0, before my code was working perfectly but now it is giving the error said:Error sending email: The AMTP ...
Stallone's user avatar
0 votes
0 answers
70 views

Why does NetworkChange.NetworkAddressChanged keep getting raised?

I am running .NET 7 on Linux. I tried get network change information with the following code, but I keep getting the event, even though the computer is constantly on, and it is a wired Ethernet. The ...
Damn Vegetables's user avatar
0 votes
1 answer
280 views

How to get Local Router Address[Not IPV4 address of device] in Xamarin

I have tried below code but it keeps on giving the me iPhone(ie.Device) IP Address. But I want to get a ROUTER IP ADDRESS public string GetIPAddress() { String ipAddress = ""; ...
iTag's user avatar
  • 409
0 votes
0 answers
159 views

Directly check a domain's SSL certificate without a callback in C#

I'm attempting to directly retrieve the SSL certificate for a given domain, so that I can access its fields (such as Issuer, Expiration date, Errors, etc). All the non-deprecated examples I can find, ...
user4779's user avatar
  • 696
0 votes
1 answer
63 views

How to create new ServerSocket C#

using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Net.Sockets; namespace PowerCarsMobileServer { class Server { public static int Port { ...
Pavel Sheludko's user avatar
0 votes
0 answers
22 views

"425 Unable to build data connection" when attempting to download files from a FTPS server using .Net with TLS 1.3 [duplicate]

I'm attempting to download files from an FTPS server using the functionality provided by System.Net (.Net Framework 4.8). I'm using the following code: var serverUri = new System.Uri("ftp://my....
Krys's user avatar
  • 39
0 votes
1 answer
384 views

Is HttpWebRequest kind of obsolete, should HttpRequestMessage + HttpClient be used instead now, since what version of .NET?

There is a similar question but my questions seems more general I've went through a few git repos and noticed Request/Response wrappers over HttpRequestMessage like CryptoExchange.Net.Requests.Request ...
Artem Vertiy's user avatar
  • 1,032
1 vote
0 answers
29 views

System.Net library is limiting outgoing requests to only two threads [duplicate]

I am working on old project, and I found weird problem, which I am not able to explain. It is about communication from my client app to server app. Server is running under IIS app pool and client is ...
Aleš Jaterka's user avatar
0 votes
1 answer
832 views

Can't import System.Net.Http on VB.Net page

I'm trying to use HttpClient on a VB.NET page (Windows Server 2019 IIS 10), but getting BC30002 error. Tracing the error in IIS, I see warning BC40056 (Namespace not found) on line: Imports System.Net....
Massimo's user avatar
  • 90
0 votes
1 answer
842 views

C# How to send a file to webhook and get sent file's link?

Hello im trying upload file to a link and i tried this: `private void buttonInput_Click(object sender, EventArgs e) { try { using (WebClient client = new WebClient()) ...
NoobCoder31's user avatar
0 votes
0 answers
117 views

C# How to upload any file to a fileuploader?

I need upload my file to "https://file.io" and i tried this: `private void buttonInput_Click(object sender, EventArgs e) { using (WebClient client = new WebClient()) { ...
NoobCoder31's user avatar
3 votes
3 answers
3k views

How to improve slow DNS with HttpClient?

I have one request for a specific domain that take a really long time to complete : 22 seconds in average. The request itself does not return a lot of data. var httpClient = new HttpClient(); //...
tigrou's user avatar
  • 4,316
-1 votes
1 answer
134 views

different ip address generated when using azure link

I have this code on how to get my IP address. Locally the code is running and I got my IP address correctly, but when I run this code using link in azure different ip address is generated. So for ...
woo25's user avatar
  • 5
0 votes
0 answers
667 views

Getting socket exception on 127.0.0.1 (error code 10049) C#

{ ipAddress = IPAddress.Parse("127.0.0.1"); remoteEndPoint = new IPEndPoint(ipAddress, portAddress); socket = new Socket(ipAddress.AddressFamily, SocketType.Stream, ...
Brian Clason's user avatar
0 votes
0 answers
55 views

HTTP WebResponse - Read data when it is available in the ResponseStream

SO Team, I have created a Server that sends the JSON string into the TCPClient Stream, This JSON Data will be sent when the user clicks on the Mouse. For Example, for every click of the position ...
Dheena's user avatar
  • 23
0 votes
0 answers
74 views

System.Net URL call not returning the expected HTML response

I am trying to query a website to scrape some information for my organization, this information is sat behind a login page which for now I am bypassing by logging into the browser using my ...
maisyk's user avatar
  • 21
0 votes
1 answer
2k views

Can you download a file from an HttpContent stream from within a Windows Forms Application?

I recently developed a .NET Web App that downloaded zip files from a certain, set location on our network. I did this by retrieving the content stream and then passing it back to the View by returning ...
user16768946's user avatar
0 votes
1 answer
562 views

Decoding and encoding PDF to send through FTP

Hello there fellow programmers! I have an issue with sending PDF through FTP. I want to copy propely created PDF to FTP directory, unfortunately file i send through has proper size but i cannot open ...
serghio's user avatar
1 vote
1 answer
704 views

What is the nslookup equivalent in C#?

I want to get the aliases that is returned by nslookup as below: F:\>nslookup maans20210630125234.sandbox.operations.test.dynamics.com Server: UnKnown Address: 2001:4898::1050:1050 Non-...
Matikur Rahman Ansari's user avatar
0 votes
0 answers
1k views

C# WebClient: The underlying connection was closed: An unexpected error occurred on a receive

I'm sorry for reposting this question. Just couldn't find an answer that was working for me. Problem This error occurs with Louis Vuitton's website but not with for example a specific ebay listing... &...
liudger's user avatar
  • 31
1 vote
1 answer
73 views

No local IP found

I want to get the local IP-Address from any Windows device. It works fine for my Desktop-PC. But when I try to get the IP of my laptop or my surface I always get 123.123.123.123. foreach (...
Kaskorian's user avatar
  • 426
0 votes
0 answers
64 views

Getting VM IP addresses from server physical address

I am using TNS Names to connect to Oracle DB. An entry that is used by application is using failover scenario with 3 DB IP addresses, all virtual. I am trying to get and display these DB IP addresses ...
NoBullMan's user avatar
  • 2,082
0 votes
1 answer
2k views

How do I add cookies to a webclient? [duplicate]

So I was looking for an answer and everything I've looked for hasn't worked. I'm using WinForms with .NET Framework 4.8 I'm very confused as to this. Anyone able to help? Code below is just an example ...
Party Parrot's user avatar
0 votes
1 answer
32 views

System.Web.Http problem affecting communication

It seems like there is a problem with the "System.Net.Http" dll. I keep getting all kind of errors relating to it: while trying to restore nuget packages (It seems like the framework can not ...
Guy E's user avatar
  • 1,805
1 vote
0 answers
43 views

IPEndPointCollection missing under System.Net

(If this is a dumb question I apologies for it, but I'm new to C# language). I'm creating a P2P system in C# with Visual Studio 2019 and I need the IPEndPointCollection class, but I don't find it ...
Luca Vezzani's user avatar
0 votes
1 answer
290 views

What values are allowed for the IsMimeMultipartContent subtype parameter

I am working on an image file upload method in Web API 2 and have noticed that the extension method IsMimeMultipartContent can take a string subtype parameter, as documented here: https://learn....
Daniel Thorne's user avatar
2 votes
1 answer
368 views

C# .Net Core 3.1: Having difficulty using System.Net.IPAddress byte order swapping

Sorry to ask about what should be a simple thing, but I've been trying to use IPAddress.NetworkToHostOrder and IPAddress.HostToNetworkOrder to no avail. I'm on Windows rig, little endian. Here's tiny ...
slackpatrol's user avatar
-1 votes
1 answer
278 views

WebClient.UploadString appears to be passing a GET when I'm explicitly doing a POST

This is a weird one can I'm not sure what is happening. I have a testing project that calls my api. Recently, it appears that when I'm calling a none https website (ie http), it's changing my verb ...
mikemurf22's user avatar
  • 1,851
1 vote
0 answers
114 views

Game-Server running on local machine but not on ubuntu server

My Server (System.Net) is working on my local mashine (win10), but not on the ubuntu server, i get this error: Unhandled exception. System.ArgumentOutOfRangeException: Specified argument was out of ...
Nissl's user avatar
  • 13
0 votes
2 answers
1k views

WebClient SSL Error: "System.Net.WebException: The SLL connection could not be established"

Hi, dear stranger! I made a console application for my telegram bot. On my laptop it works perfectly, but on my PC which i want to use as a server this code gets an error. I spent the whole day ...
Funny Fat Man's user avatar
0 votes
1 answer
248 views

No connection could be made because the target machine actively refused it - TCP

I need help with my situation. Erorr is "No connection could be made because the target machine actively refused it" when run client.Connect(). Thank you! private void btnSend_Click(object sender, ...
Punfake's user avatar
0 votes
0 answers
36 views

I Can't Take Data From Net With HtmlAgilityPack throwing NullReferenceExeption Error [duplicate]

I can't do anything using XPath, I don't know why this isn't working? I tried many ways still I ended up with NullReferenceException error. I really need your help :/ You can look at the code full ...
Burak Taha's user avatar
1 vote
0 answers
189 views

What is the relationship between ServicePointManager.DefaultConnectionLimit and system.net connectionManagement maxconnection?

Do these two settings refer to the same limit or seperate limits? (don't fixate on the number, I put that in at random) System.Net.ServicePointManager.DefaultConnectionLimit = 20; The above property ...
Andrew M's user avatar
  • 9,209
4 votes
1 answer
966 views

is system.net connectionManagement maxConnection per domain or shared when using wildcard address?

The documentation for the maxconnection configuration value in the system.net connectionManagement section of a config file is confusing me. When you use a wildcard in the address - is that limit per ...
Andrew M's user avatar
  • 9,209
1 vote
2 answers
3k views

MemoryStream from HttpContent without copying

I m trying to use System.Net.Http for POST requests. I m ok with HTTP response body being in memory but need to obtain MemoryStream for it. One way to do that would be to call HttpContent....
Yevgeniy P's user avatar
  • 1,510
1 vote
0 answers
400 views

C# Is the TcpListener limited to local area network or is something wrong with my code?

I have a problem with my chat app : it doesn't work over the network . I tried port-forwarding and other similar methods. I'm starting to question my code . I'm new to networking so please help me ...
KillTheKiller's user avatar
0 votes
0 answers
492 views

System.TypeLoadException : Could not load type System.Net.HttpStatusCode, netstandard, while decoding custom attribute: (null)

The problem occurs between a Xamarin.IOS type project and a .NetStandard2.0 library. I have created a small solution (link here) demonstrating the problem. To achieve this, the Xamarin project uses ...
Xavier Larocque's user avatar
0 votes
1 answer
1k views

C# Read all response from an HTTP response Windows System.Net.Http

This is my method, an async HTTP POST : using System; //main data types using System.Net.Http; //for HTTP client using System.Threading.Tasks; ...
Nick's user avatar
  • 481
7 votes
4 answers
2k views

Using "System.Net.Dns.GetHostEntry()" to get the IP address for a website, will give different results compared to some online IP checker sites

I am working on a c# console application, and inside my console application, i have the following code, to get the IP for a website:- using System.Net using System.Web; using System.IO; namespace ...
John John's user avatar
1 vote
0 answers
157 views

Response URL is returning previous Imgur image URL instead of current image URL

I've built a new Unity project that makes use of C# and System.Net to access Imgur's API. I'm able to pull images into my application from anywhere, and I can upload screenshots to Imgur through my ...
RMGCode's user avatar
  • 11
0 votes
0 answers
75 views

Twitter Search API returns null Object

I have been using the Tweetinvi library to search tweets(.NET 4.7.2) for my application. Till last week the application worked fine without issues. Recently I have noticed that the application would ...
s_om's user avatar
  • 661
0 votes
1 answer
116 views

How can I get "How many Network data(Mobile or WiFi) used when I call API in c# desktop application"

How can I get "How many Network data(Mobile or WiFi) used when I call API in c# desktop application" I want to know How can i get total used data when i call API service I have done following code: ...
Hardik Masalawala's user avatar
0 votes
0 answers
70 views

Is it possible to get a list of IPEndPoints on a remote pc on my network using c#

As the title suggests, I'd like to know if it's possible to get a list of System.Net.IPEndPoint on a remote server. I know this can be done on a local machine using ipGlobalProperties....
Karl's user avatar
  • 922
4 votes
3 answers
6k views

Unable to fix error "Could not load System.Net.Http, Version=4.2.0.0"

On my production server I get the error: Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system ...
Adam's user avatar
  • 6,161

1
2 3 4 5
7