rdagumampan / yuniql

Free and open source schema versioning and database migration made natively with .NET/6. NEW THIS MAY 2022! v1.3.15 released!
https://yuniql.io
Apache License 2.0
419 stars 64 forks source link

The type initializer for 'Microsoft.Data.SqlClient.SNILoadHandle' threw an exception #273

Closed rdagumampan closed 2 years ago

rdagumampan commented 2 years ago

Error thrown when using installation from choco and downloaded exe file. This is because Microsoft.Data.SqlClient.SNI.dll is excluded when publishing self-contained application. Patch release is underway!

ERR   2022-05-24 18:41:45Z   Failed to execute run function. The type initializer for 'Microsoft.Data.SqlClient.TdsParser' threw an exception. Diagnostics stack trace captured a The type initializer for 'Microsoft.Data.SqlClient.TdsParser' threw an exception. The type initializer for 'Microsoft.Data.SqlClient.SNILoadHandle' threw an exception. If you think this is a bug, please report an issue here https://github.com/rdagumampan/yuniql/issues.
ERR   2022-05-24 20:55:24Z   Failed to execute run function. The type initializer for 'Microsoft.Data.SqlClient.TdsParser' threw an exception.
Diagnostics stack trace captured a System.TypeInitializationException:
 ---> System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SNILoadHandle' threw an exception.
 ---> System.DllNotFoundException: Dll was not found.
   at Microsoft.Data.SqlClient.SNINativeMethodWrapper.SNIInitialize(Boolean useSystemDefaultSecureProtocols, IntPtr pmo)
   at Microsoft.Data.SqlClient.SNINativeMethodWrapper.SNIInitialize()
   at Microsoft.Data.SqlClient.SNILoadHandle..ctor()
   at Microsoft.Data.SqlClient.SNILoadHandle..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.Data.SqlClient.TdsParserStateObjectFactory.get_EncryptionOptions()
   at Microsoft.Data.SqlClient.TdsParser..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.Data.SqlClient.TdsParser..ctor(Boolean MARS, Boolean fAsynchronous)