Executing a UWP application in DEBUG works perfectly.
Using exactly the same code compiled in RELEASE crashes with this error message
System.PlatformNotSupportedException:
'Dynamic code generation is not supported on this platform.'
when executing this code (it's using Dapper 1.5.1 and System.Data.SQLite 1.0.109.2)
using (var c = NewConnection())
{
var sql = @"
update settings
set
""value"" = @SetDate
where ""key"" = 'week_date'";
c.Execute(sql, new { SetDate = date }); //<= throws PlatformNotSupportedException
// only on RELEASE not in DEBUG
}
The application is UWP configured as below. Furthermore, the faulting code is a .NET Standard 2.0 Class Library
Why is it crashing on RELEASE only and how to fix it?
