New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeInitializationException in Mono starting in 3.2.16 with MS SQL Server #1483
Comments
Thanks. It looks like our tests should cover Mono somehow. There was another report in #1486 of a similar issue with a different stack trace, but I'm not sure if they were using Mono. |
Microsoft.Data.SqlClient 4.0.0 fixes this, but introduces another error, where only setting Encrypt=false avoids. |
The crux of the problem is using net461 (or legacy .NET Framework) with Mono on Linux. |
@arhughes The maintainer of Microsoft.Data.SqlClient wrote back that Microsoft.Data.SqlClient netfx implementation relies on system calls unavailable on Linux. He suggested if you need to use SQL Server on Linux, you use System.Data.SqlClient (I believe, but am not positive, that is what he meant by saying "use the correct platform implementation assembly"). I suppose the short-term fix here would be to have a processorId mssql-linux. However, given .NET Framework is now a decade old technology, I'm not interested in spending the time to fix this. I'm open to taking PRs, but otherwise the complexity just doesn't interest me. |
The latest update here comes from @lillo42 who troubleshot this awhile ago: dotnet/SqlClient#1263, in particular see: dotnet/SqlClient#1263 (comment)
However, if you search their repository, you will see as of last month that monoandroid still doesn't work correctly. Referring back to my message two years ago, I think the right path forward is to add a special DI syntax to hook-in the older package (database driver library System.Data.SqlClient). @lillo42 Any thoughts? @arhughes You are free to add our own thoughts if you know any better, as well. I don't use mono so I am not an expert here. |
Describe the bug
Starting in version 3.2.16, running any migrations on Mono against MS SQL Server fail with the error:
This appears to be caused #1436, which moved to Microsoft.Data.SqlClient and apparently does not support Mono.
To Reproduce
Try to run any migration with a SqlServer provider under Mono. An example showing that Microsoft.Data.SqlClient is not supported under Mono is shown here: https://gist.github.com/arhughes/8b15d7ee88da250cc4492814cac6db52 and produces the same error with a full stack trace:
Expected behavior
Migrations can be run with a SqlServer provider under Mono.
Information:
microsoft/mssql-server-linux:2017-latest
)Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: