Re: C# project, MySql.Data.dll 8.0.26 & .NET Framework 4.8 issue
Posted by: Harun KILIÇ
Date: October 26, 2021 11:20AM

Hi;
MySql.Data.dll ( version 8.0.27.0) causes error with unsafe code, with the previous versions (8.0.23, 8.0.25) there is no issue.

public static unsafe byte[] GetSpanBytes(this string str)
{
if (str == null) throw new ArgumentNullException(nameof(str));

if (str.Length == 0) return new byte[0];

fixed (char* p = str)
{
return new Span<byte>(p, str.Length * sizeof(char)).ToArray();//Exception
occurs here when MySql.Data.dll 8.0.27 is added as a reference
}
}


FileNotFoundException: 'System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' dosyasını veya bütünleştirilmiş kodunu ya da bağımlılıklarından birini yükleyemedi. Sistem belirtilen dosyayı bulamıyor.

Options: ReplyQuote


Subject
Written By
Posted
Re: C# project, MySql.Data.dll 8.0.26 & .NET Framework 4.8 issue
October 26, 2021 11:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.