7
Answers

Help me out I dn't know C#

Photo of ravi birlangi

ravi birlangi

16y
6.7k
1

HI,

    I am getting the following exception is my log file, can any one help me in indentifying the issue?? Is it network issue? or any suggestion , how to proceed 

My C# code is trying to ping  different severs for information. But getting the following exception.

 

Server Pingable ==> XYZ
Exception in getting printer details  Object reference not set to an instance of an object.
Exception in connectToServer System.Net.NetworkInformation.PingException: An exception occurred during a Ping request. ---> System.Net.Sockets.SocketException: No such host is known
   at System.Net.Dns.GetAddrInfo(String name)
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
   at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
   --- End of inner exception stack trace ---
   at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
   at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress)
   at Connect.connectToServer(String ServerName)
Exception in connectToServer System.Net.NetworkInformation.PingException: An exception occurred during a Ping request. ---> System.Net.Sockets.SocketException: No such host is known
   at System.Net.Dns.GetAddrInfo(String name)
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
   at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
   --- End of inner exception stack trace ---
   at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
   at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress)
   at Connect.connectToServer(String ServerName)
Exception in connectToServer System.Net.NetworkInformation.PingException: An except

Answers (7)

0
Photo of Dipika
NA 1.2k 14.6k 7y
my task is to upload file with updated version 6th step of following url
 
https://developer.autodesk.com/en/docs/data/v2/tutorials/upload-file/ 
0
Photo of Mitesh Gadhiya
NA 305 11.1k 7y
  1. var url = "API URL";  
  2. var jsonData = "[{...json data...}]";  
  3.   
  4. using (var client = new WebClient())  
  5. {  
  6.     client.Headers.Add("content-type""application/json");  
  7.     var response = client.UploadString(url, jsonData);  
 Try this
0
Photo of Dipika
NA 1.2k 14.6k 7y
I have to integrate this 
https://developer.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-versions-POST/ 
0
Photo of Dipika
NA 1.2k 14.6k 7y
What should i pass in query string or in request.AddHeader
0
Photo of Mitesh Gadhiya
NA 305 11.1k 7y
Please have a look at below thread it might be helpful to you:
 
https://stackoverflow.com/questions/7929013/making-a-curl-call-in-c-sharp