Search Unity

2017.2 OSX, trouble with .NET libs

Discussion in 'Editor & General Support' started by Cherubim79, Nov 28, 2017.

  1. Cherubim79

    Cherubim79

    Joined:
    May 3, 2014
    Posts:
    56
    I'm trying to get a few things to work with .NET 4.6, namely Mono.Data.Sqlite.SqliteConnection and System.Net.WebClient, I definitely need those two things. Where should I be copying the proper libraries from?

    On OSX Standalone with a SqliteConnection as soon as I do an Open() with a connection string I get an error that says you can't have any other DataReaders open. There's no other connections, no other scripts using SqliteConnection, no other DataReaders/Commands. Also it works fine on the Editor, just not standalone.

    Code (csharp):
    1.  
    2.         Mono.Data.Sqlite.SqliteConnection conn = new SqliteConnection(connectionString);
    3.         conn.Open();
    4.         var cmd = conn.CreateCommand();
    5.         cmd.Dispose();
    6.         conn.Close();
    7.         conn.Dispose();
    8.  
    9. Cannot set CommandText while a DataReader is active
    10.   at Mono.Data.Sqlite.SqliteCommand.set_CommandText (System.String value) [0x0002d] in <d8357a51a8a3460c8b48af82e5db2e98>:0
    11.   at (wrapper remoting-invoke-with-check) Mono.Data.Sqlite.SqliteCommand:set_CommandText (string)
    12.   at Mono.Data.Sqlite.SqliteConnection.Open () [0x0040d] in <d8357a51a8a3460c8b48af82e5db2e98>:0
    13.  
    On WebClient http requests work, but https tells me it can't find Security. The workaround is using WWW, but doing Coroutines when you have several web requests is a lot more code overhead than just using an await with WebClient. I just need to know exactly what to include.

    Code (csharp):
    1.  
    2.         WebClient wc = new WebClient();
    3.         byte [] blah = wc.DownloadData(@"https://www.anyhttpssite.com");
    4.  
    5. DllNotFoundException: Security
    6. Mono.AppleTls.AppleTlsContext.InitializeConnection () (at <344dc4d3f1ad41809df78607b6121a41>:0)
    7. Mono.AppleTls.AppleTlsContext.StartHandshake () (at <344dc4d3f1ad41809df78607b6121a41>:0)
    8. Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncProtocolRequest asyncRequest, Mono.Net.Security.AsyncOperationStatus status) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    9. Mono.Net.Security.AsyncProtocolRequest.ProcessOperation (Mono.Net.Security.AsyncOperationStatus status) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    10. Mono.Net.Security.AsyncProtocolRequest.ProcessOperation () (at <344dc4d3f1ad41809df78607b6121a41>:0)
    11. Mono.Net.Security.AsyncProtocolRequest.StartOperation () (at <344dc4d3f1ad41809df78607b6121a41>:0)
    12. Mono.Net.Security.AsyncProtocolRequest.StartOperation (Mono.Net.Security.AsyncOperation operation) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    13. Mono.Net.Security.MobileAuthenticatedStream.ProcessAuthentication (System.Net.LazyAsyncResult lazyResult) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    14. --- End of stack trace from previous location where exception was thrown ---
    15. System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151)
    16. Mono.Net.Security.MobileAuthenticatedStream.ProcessAuthentication (System.Net.LazyAsyncResult lazyResult) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    17. Mono.Net.Security.MobileAuthenticatedStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    18. Mono.Net.Security.Private.MonoSslStreamWrapper.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    19. Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    20. System.Net.WebConnection.CreateStream (System.Net.HttpWebRequest request) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    21. Rethrow as WebException: Error: SecureChannelFailure (Security)
    22. System.Net.WebClient.DownloadDataInternal (System.Uri address, System.Net.WebRequest& request) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    23. System.Net.WebClient.DownloadData (System.Uri address) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    24. System.Net.WebClient.DownloadData (System.String address) (at <344dc4d3f1ad41809df78607b6121a41>:0)
    25. (wrapper remoting-invoke-with-check) System.Net.WebClient:DownloadData (string)
    26.