I'm using Dapper, .NET Core 2 and MySql.Data to create a small REST API on Linux. Unfortunately, i keep getting this error on my connection:
Exception has occurred: CLR/System.IO.FileNotFoundException
An exception of type 'System.IO.FileNotFoundException' occurred in MySql.Data.dll but was not handled in user code: 'Could not load file or assembly 'System.Security.Permissions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.'
at MySql.Data.MySqlClient.MySqlConnection.AssertPermissions()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at Dapper.SqlMapper.<QueryImpl>d__124`1.MoveNext()
Does anyone have any idea what is going on?
Try adding System.Security.Permissions, Version=4.0.0.0
from nuget.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With