Skip to content

Instantly share code, notes, and snippets.

@SneWs
Last active February 7, 2024 21:37
Show Gist options
  • Save SneWs/5c9baa2945f398c7b4661a450876e0da to your computer and use it in GitHub Desktop.
Save SneWs/5c9baa2945f398c7b4661a450876e0da to your computer and use it in GitHub Desktop.
MessagePack console code example to generate crash on Windows
using MessagePack;
public static class GameMessages
{
[MessagePackObject]
public sealed class PlayerSpawned
{
[Key(0)]
public float Yaw { get; set; }
[Key(1)]
public float Pitch { get; set; }
// ... etc
public PlayerSpawned()
{ }
public PlayerSpawned(float yaw, float pitch)
{
Yaw = yaw;
Pitch = pitch;
}
}
}
public static class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MessagePack" Version="2.5.140" />
<PackageReference Include="MessagePack.Annotations" Version="2.5.140" />
</ItemGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment