Skip to main content
GameDev.net gamedev.net
🔒 Locked

SqlException: System.Net.Security.Native in Unity

Started by RobbyT15 Apr 13, 2019 at 1:22 PM 4 replies 3.8k views
Original Post
RobbyT15
RobbyT15

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

Alberth
Alberth

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

RobbyT15
RobbyT15
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

Alberth
Alberth

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.


GWDev
GWDev
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.