open-dis-csharp icon indicating copy to clipboard operation
open-dis-csharp copied to clipboard

Won't compile without error .NET8 - This call is ambiguous...

Open jeff922 opened this issue 1 year ago • 0 comments

After cloning repo, upgrading to .NET8 release, and building the following error occurs in:

\open-dis-csharp\CsharpDis6\OpenDis\Enumerations\Entity.Information.Minefield\PaintScheme.cs line 275 public byte[] ToByteArray() => BitConverter.GetBytes(ToByte());

CS0121 The call is ambiguous between the following methods or properties: 'BitConverter.GetBytes(Half)' and 'BitConverter.GetBytes(short)'

This may have been introduced in .NET 7 per the post below: https://github.com/dotnet/runtime/issues/79034

Recommend changing line to the following to support .NET 8 and past versions public byte[] ToByteArray() => BitConverter.GetBytes((short)ToByte());

jeff922 avatar Nov 17 '23 14:11 jeff922