Advertisement

SqlException: System.Net.Security.Native in Unity

Started by April 13, 2019 01:22 PM
4 comments, last by GWDev 5 years, 6 months ago

I'm receiving the error in the attached image in Unity while trying to connect to my SQL Database. I'm assuming that it has something to do with a missing dll but I'm not sure. Can anyone explain to me what I need to do to fix it?

Capture.PNG

No error message attached to the exception? That may give you more detailed information what  is wrong.

Advertisement
26 minutes ago, Alberth said:

No error message attached to the exception? That may give you more detailed information what  is wrong.

The closest thing to an error message I get is in the image on this reply.

Capture.PNG

That is not an error message, that is a stack-dump. (That is, the nested function calls that were active at the time the exception happened.)

I don't know what .net does with error-messages if it dumps the stack, but in case it doesn't show the message by default, you can try the following:

In that stack-dump find the function in your code that was active. Change that code by catching the exception, retrieve and print the message from the exception (or save it somewhere), and probably then rethrow it, or exit in some other way.

 

By the way, it is good practice to always check returned results from calls to the system (or in this case, catch raised exceptions), and deal with  them in a proper way. It avoids the situation you're in now, a crashed program and no idea what is wrong.

 

On 4/13/2019 at 3:22 PM, RobbyT15 said:

in Unity while trying to connect to my SQL Database

If this is released to the public you probably shouldn't connect directly to the database.
Add some (Web/REST/SOAP/etc-)API to handle authorization, authentication and dataflow beween the game client and your database.

Without further information my guess is, you are using C# functionality that's not 100% supported by Unity.
But the exception message would help in indetifying the problem.

This topic is closed to new replies.

Advertisement