SQL Server connection with Unity - c#

I'm trying to connect my Unity project to SQL Server. I have connected my Windows Forms application in Visual Studio 2017 successfully. And I think if copy the exact code in a unity script my goal should happen. I have imported System.Data.Dll V3.5 to my assets and using unity2018.2.1.f1. I am using the following script trying to first open the connection but I get the error below.
void Start ()
{
try
{
string ConnString = "Data Source=DESKTOP-PVB5MHG;Initial Catalog=UnityTest;User ID=legend;Password=legend";
SqlConnection MyConn = new SqlConnection(ConnString);
MyConn.Open();
Debug.Log("Connection opened !");
}
catch(System.Exception ex)
{
Debug.Log(ex.ToString());
}
}
System.Data.SqlClient.SqlException: Server does not exist or
connection refused.
Mono.Data.Tds.Protocol.TdsInternalException: Server does not exist or connection refused.
System.Net.Sockets.SocketException: An address incompatible with the requested protocol was used.
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP,
Boolean requireSocketPolicy) [0x00000] in :0
at System.Net.Sockets.Socket+Worker.Connect () [0x00000] in :0
--- End of inner exception stack trace ---
at Mono.Data.Tds.Protocol.TdsComm..ctor (System.String dataSource, Int32
port, Int32 packetSize, Int32 timeout, TdsVersion tdsVersion) [0x00000] in :0
at Mono.Data.Tds.Protocol.Tds..ctor (System.String dataSource, Int32
port, Int32 packetSize, Int32 timeout, TdsVersion tdsVersion) [0x00000] in :0
at Mono.Data.Tds.Protocol.Tds70..ctor (System.String server, Int32 port,
Int32 packetSize, Int32 timeout, TdsVersion version) [0x00000] in
:0 at Mono.Data.Tds.Protocol.Tds80..ctor
(System.String server, Int32 port, Int32 packetSize, Int32 timeout)
[0x00000] in :0 at
Mono.Data.Tds.Protocol.TdsConnectionPoolManager.CreateConnection
(Mono.Data.Tds.Protocol.TdsConnectionInfo info) [0x00000] in :0 at
Mono.Data.Tds.Protocol.TdsConnectionPool.GetConnection () [0x00000] in
:0 at System.Data.SqlClient.SqlConnection.Open ()
[0x00000] in :0 --- End of inner exception stack
trace --- at System.Data.SqlClient.SqlConnection.Open () [0x00000]
in :0 at DB.Start () [0x00010] in
D:\UnityProjects2018\DataBaseTest1\Assets\DB.cs:15
UnityEngine.Debug:Log(Object) DB:Start() (at Assets/DB.cs:20)

You cannot use ODBC in Unity due to limitations in Mono. Use http://github.com/dotnet/SqlClient instead.
Your specific error is related to the differences in how machine names are resolved in Mono versus the ancient version of .Net framework of the WinForms era. DESKTOP-PVB5MHG will not be a valid DNS name, while Mono only uses DNS to resolve Data Source.

Related

How to connect with an IPv6 address using SSH.NET library in C#

I want to connect via SSH to a remote GNU+Linux machine and execute a command, but with an IPv6 address. With an IPv4 address it works perfectly fine.
I am running on Ubuntu 15.04 and use MonoDevelop (Mono 4.0)
Here is my sample code using Renci SSH.NET library:
SshClient sshClient = new SshClient (ipV6Address, user, pass);
sshClient.Connect ();
SshCommand sshCmd = sshClient.RunCommand (command);
sshClient.Disconnect ();
I also tried to use Tamirs SshSharp and Terminal Control.
Adding [ ] to the IPv6 address didn't work either.
I get following exception:
System.Net.Sockets.SocketException: Invalid arguments
at System.Net.Sockets.Socket+SocketAsyncResult.CheckIfThrowDelayedException () [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.EndConnect (IAsyncResult result) [0x00000] in <filename unknown>:0
at Renci.SshNet.Session.SocketConnect (System.String host, Int32 port) [0x00000] in <filename unknown>:0
at Renci.SshNet.Session.Connect () [0x00000] in <filename unknown>:0
at Renci.SshNet.BaseClient.Connect () [0x00000] in <filename unknown>:0
at main program...
Maybe someone could provide me a code example (in C#) or tell me a library that clearly supports IPv6 addresses. The library should be free (preferably with Apache license) and usable for commercial use.
Greetings Wima
EDIT:
After coming to the conclusion that my ipAddress lacks the network interface I changed my ipAddress to "fe80::xxxx:xxxx:xxxx:xxxx%2" (yes 2 is the right one, I tested with ping6).
This seems to work a bit "more", because the exception changed into:
System.ArgumentException: host
at Renci.SshNet.ConnectionInfo..ctor (System.String host, Int32 port, System.String username, ProxyTypes proxyType, System.String proxyHost, Int32 proxyPort, System.String proxyUsername, System.String proxyPassword, Renci.SshNet.AuthenticationMethod[] authenticationMethods) [0x00000] in <filename unknown>:0
at Renci.SshNet.PasswordConnectionInfo..ctor (System.String host, Int32 port, System.String username, System.Byte[] password, ProxyTypes proxyType, System.String proxyHost, Int32 proxyPort, System.String proxyUsername, System.String proxyPassword) [0x00000] in <filename unknown>:0
at Renci.SshNet.PasswordConnectionInfo..ctor (System.String host, Int32 port, System.String username, System.String password) [0x00000] in <filename unknown>:0
at Renci.SshNet.SshClient..ctor (System.String host, Int32 port, System.String username, System.String password) [0x00000] in <filename unknown>:0
at Renci.SshNet.SshClient..ctor (System.String host, System.String username, System.String password) [0x00000] in <filename unknown>:0
at main program...
SOLVED
Using the pre-release package of SSH.NET solved my problem!
Thanks to #MartinPrikryl and others ;)
If you connect to a link local adress (FE80::) then you need to specify the interface name with a % eg FE80::%eth0
Because you can have multiple link local addresses and you need to tell your OS which interface to use. With unicast addresses the OS knows due to the routing table what interface to use.

Mono.Security.Protocol.Tls.TlsException: buffer underrun

I have a very strange problem.
We implemented a Soap API to talk to a third party. The API sort of works. There is an IsAlive method which checks if the third party service is alive.
Our application is hosted on an Ubuntu 14.04 server under Apache with Mod-Mono (Mono).
We call this API when we load a particular page. It works up to a point then we get an error. I.E. You can make a request to the IsAlive xxx (It's random) amount of times and it works, then next time you try and do it the following exception gets thrown:
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Net.WebException: Error writing headers ---> System.IO.IOException: Error while sending TLS Alert (Fatal:InternalError): System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: buffer underrun
at Mono.Security.Protocol.Tls.RecordProtocol.ReadRecordBuffer (Int32 contentType, System.IO.Stream record) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (IAsyncResult result) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: buffer underrun
at Mono.Security.Protocol.Tls.RecordProtocol.ReadRecordBuffer (Int32 contentType, System.IO.Stream record) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (IAsyncResult result) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Net.WebConnection.EndWrite (System.Net.HttpWebRequest request, Boolean throwOnError, IAsyncResult result) [0x00000] in <filename unknown>:0
at System.Net.WebConnectionStream+<SetHeadersAsync>c__AnonStorey1.<>m__0 (IAsyncResult r) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse (System.Net.WebRequest request) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Web.UI.Page.ProcessException (System.Exception e) [0x00000] in <filename unknown>:0
at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at ASP.somepage_aspx.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0
at System.Web.HttpApplication.Tick () [0x00000] in <filename unknown>:0
Mono.Security.Protocol.Tls.TlsException: buffer underrun
at Mono.Security.Protocol.Tls.RecordProtocol.ReadRecordBuffer (Int32 contentType, System.IO.Stream record) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
The API at this point does not work anymore. Even if we refresh the page and make another call. We try to re-request 2-3 times then we get another error.
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Net.WebException: The request timed out
at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in <filename unknown>:0
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String method_name, System.Object[] parameters) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Web.UI.Page.ProcessException (System.Exception e) [0x00000] in <filename unknown>:0
at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at ASP.somepage_aspx.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0
at System.Web.HttpApplication.Tick () [0x00000] in <filename unknown>:0
System.Net.WebException: The request timed out
at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in <filename unknown>:0
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String method_name, System.Object[] parameters) [0x00000] in <filename unknown>:0
The only way to make the API work again is if we restart the Ubuntu Server.
Here is a snippet of how we send the request.
public string TestSiteStatus()
{
getSiteStatus site = new getSiteStatus();
site.site = "XXX";
string res = "";
using (SiteServiceImplService service = new SiteServiceImplService())
{
res = service.getSiteStatus(site);
}
return res;
}
Does anyone know what is wrong here? Is there a problem with my implementation or is this a Mono framework issue?
I have tried the instructions on this page: http://www.mono-project.com/docs/faq/security/ but no success. When I run thetest, it passes the first and sometimes the second time but fails after that.
Turns out there was a certificate issue with our third party. They updated their certificates, we added them to our stores, and it worked.
Our the API SSL cert was vulnerable to a LogJam attack. The ciphering of the certificate caused problems with our server.
This link helped us test and find the problem.

Running VS compiled C#(serial connection) file on linux with mono

From what I've heard it should be possible to run a visual studio compiled C# file on linux by using C# mono. I installed it using apt-get install mono-complete so everything should be included
I do however get some Unhandled Exception errors I do not understand myself and I hope that someone might be able to help me out. I should note that everything works as intended on a windows machine and that I have compensated ports and so on so it should fit linux instead.
My setup looks like :
_serialPort = new SerialPort();
_serialPort.PortName = SetPortName(_serialPort.PortName);
_serialPort.BaudRate = 115200;
_serialPort.StopBits = StopBits.One;
_serialPort.Parity = Parity.None;
_serialPort.DataBits = 8;
_serialPort.Handshake = 0;
_serialPort.ReadTimeout = 500;
_serialPort.WriteTimeout = 500;
_serialPort.Open();
and the errors I get are :
System.IO.IOException: Invalid argument
at System.IO.Ports.SerialPortStream.ThrowIOException () [0x00000] in <filename unknown>:0
at System.IO.Ports.SerialPortStream.SetSignal (SerialSignal signal, Boolean value) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPortStream:SetSignal (System.IO.Ports.SerialSignal,bool)
at System.IO.Ports.SerialPortStream..ctor (System.String portName, Int32 baudRate, Int32 dataBits, Parity parity, StopBits stopBits, Boolean dtrEnable, Boolean rtsEnable, Handshake handshake, Int32 readTimeout, Int32 writeTimeout, Int32 readBufferSize, Int32 writeBufferSize) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPortStream:.ctor (string,int,int,System.IO.Ports.Parity,System.IO.Ports.StopBits,bool,bool,System.IO.Ports.Handshake,int,int,int,int)
at System.IO.Ports.SerialPort.Open () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPort:Open ()
at TivaCOM.setup () [0x00000] in <filename unknown>:0
at TivaCOM.Main () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.IOException: Invalid argument
at System.IO.Ports.SerialPortStream.ThrowIOException () [0x00000] in <filename unknown>:0
at System.IO.Ports.SerialPortStream.SetSignal (SerialSignal signal, Boolean value) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPortStream:SetSignal (System.IO.Ports.SerialSignal,bool)
at System.IO.Ports.SerialPortStream..ctor (System.String portName, Int32 baudRate, Int32 dataBits, Parity parity, StopBits stopBits, Boolean dtrEnable, Boolean rtsEnable, Handshake handshake, Int32 readTimeout, Int32 writeTimeout, Int32 readBufferSize, Int32 writeBufferSize) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPortStream:.ctor (string,int,int,System.IO.Ports.Parity,System.IO.Ports.StopBits,bool,bool,System.IO.Ports.Handshake,int,int,int,int)
at System.IO.Ports.SerialPort.Open () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPort:Open ()
at TivaCOM.setup () [0x00000] in <filename unknown>:0
at TivaCOM.Main () [0x00000] in <filename unknown>:0
If someone could help me out I would be very grateful
First of all, most probably your VS C# exe is compiled with Windows dependencies and especially when talking about hardware like USB and serial ports, there are tons of differences between platforms. If you have the source code then you can try the suggested approach in this thread How to convert a .NET exe to native Win32 exe?, to compile the code without compiling the native part.
If you do not have the source code and you have just the exe, you need to use the wine approach where you run your code in wine. You can use the following post on how to set the correspondence between linux serial devices and wine ( windows COMXX devices) http://ubuntuforums.org/showthread.php?t=1335098.
If you are using a recent linux distribution you will have to allow access to the ttySXX ports for your user by adding the user to the group dialout.

c# - "The authentication or decryption has failed." error while using twitterizer in mono

why i get this error
Unhandled Exception: Twitterizer.TwitterizerException: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure ---> System.Net.WebException: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a
at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Mono.Security.X509.X509CertificateCollection certificates) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1 () [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process ()
at Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage (Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0
at Twitterizer.WebRequestBuilder.ExecuteRequest () [0x00000] in <filename unknown>:0
at Twitterizer.OAuthUtility.GetRequestToken (System.String consumerKey, System.String consumerSecret, System.String callbackAddress) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Twitterizer.OAuthUtility.GetRequestToken (System.String consumerKey, System.String consumerSecret, System.String callbackAddress) [0x00000] in <filename unknown>:0
at terminal_twitt.Program.Main (System.String[] args) [0x00000] in /home/julio/Projects/terminal-twitt/terminal-twitt/Program.cs:18
[ERROR] FATAL UNHANDLED EXCEPTION: Twitterizer.TwitterizerException: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure ---> System.Net.WebException: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a
at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Mono.Security.X509.X509CertificateCollection certificates) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1 () [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process ()
at Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage (Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0
at Twitterizer.WebRequestBuilder.ExecuteRequest () [0x00000] in <filename unknown>:0
at Twitterizer.OAuthUtility.GetRequestToken (System.String consumerKey, System.String consumerSecret, System.String callbackAddress) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Twitterizer.OAuthUtility.GetRequestToken (System.String consumerKey, System.String consumerSecret, System.String callbackAddress) [0x00000] in <filename unknown>:0
at terminal_twitt.Program.Main (System.String[] args) [0x00000] in /home/julio/Projects/terminal-twitt/terminal-twitt/Program.cs:18
The application was terminated by a signal: SIGHUP
i use twitterizer and mono 2.6 for linux with .NET 4.0 runtime in it. i have tried this code with visual studio in my windows, and worked perfectly. but when i tried to build it with mono i get this error.
here is my code:
static void Main(string[] args)
{
string requestToken = OAuthUtility.GetRequestToken("my consumer key", "my consumer secret", "oob").Token;
}
I had the same problems so simply talking i choose to import all certificates using
mozroots --import --ask-remove
and now I can login with twitter
See the Mono project wiki:
FAQ Security on SSL/TLS; and
Using Trusted Roots Respectfully article
They will show you how to add the missing x.509 certificates on your system (users) and how to best deal with such situations inside your own application (developers).
Works for setup of kvm with mono and vNext too - otherwise you can't do
kpm restore -s https://www.myget.org/F/aspnetvnext/
Many thanks for the tip!
From mono's documentation:
Note that if you are using a web application (i.e. not the current user) you must add the --machine option like this:
mozroots --import --ask-remove --machine
*you might want to run this with sudo

WebClient "error getting response stream"

I've just got an error report from a client using a program I wrote, and I've been googling the nuts off of this error and can't find anything useful. The error is:
System.Net.WebException: Error getting response stream (ReadDone2): ReceiveFailure ---> System.Exception: at System.Net.WebConnection.HandleError(WebExceptionStatus st, System.Exception e, System.String where)
at System.Net.WebConnection.ReadDone(IAsyncResult result)
at System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0
at System.Net.WebClient.GetWebResponse (System.Net.WebRequest request) [0x00000] in <filename unknown>:0
at System.Net.WebClient.DownloadFileCore (System.Uri address, System.String fileName, System.Object userToken) [0x00000] in <filename unknown>:0
at System.Net.WebClient.<DownloadFileAsync>m__F (System.Object state) [0x00000] in <filename unknown>:0
System.Net.WebException: Error getting response stream (ReadDone2): ReceiveFailure ---> System.Exception: at System.Net.WebConnection.HandleError(WebExceptionStatus st, System.Exception e, System.String where)
at System.Net.WebConnection.ReadDone(IAsyncResult result)
at System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0
at System.Net.WebClient.GetWebResponse (System.Net.WebRequest request) [0x00000] in <filename unknown>:0
at System.Net.WebClient.DownloadFileCore (System.Uri address, System.String fileName, System.Object userToken) [0x00000] in <filename unknown>:0
at System.Net.WebClient.<DownloadFileAsync>m__F (System.Object state) [0x00000] in <filename unknown>:0
The application is the launcher program for a game, it pulls down a manifest of files and patches any which are non-existent or outdated. All the files it downloads with a WebClient object, it looks like the error is being thrown by WebClient::DownloadFileAsync, but I can't find any documentation as to why this could be happening.
Any help would be much appreciated, the quicker I can fix this monday morning the better!
Cheers
Joe
Does the client uses a proxy?
If yes, are you attaching the proxy to the WebClient object?
Your error simply mentions that the file could not be found, DownloadFileAsync needs a file stream, and if that's not there, you get an error...
Any thoughts in implementing a log system that can be activate through a parameter that would POST the log file into your FTP for example?
You could make use of several open source projects out there, like ExceptionReporter.
After the sysadmin played with the server config a bit this problem seemed to go away, I'm not sure exactly what was done though.

Categories

Resources