Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual static method 'Serialize' is not implemented on type #336

Open
vanhaodev opened this issue Oct 8, 2024 · 1 comment
Open

Virtual static method 'Serialize' is not implemented on type #336

vanhaodev opened this issue Oct 8, 2024 · 1 comment

Comments

@vanhaodev
Copy link

image
image

@harayuu9
Copy link

I encountered the same situation, but since this issue lacks sufficient explanation, I can’t be certain it refers to the same thing. Nonetheless, I’ll describe the probable situation and the approach to address it. The issue occurs when a class library containing a MessagePackable targeting .NET Standard 2.1 is referenced in an application created with .NET 7 or 8. This is caused by MemoryPack changing the generated code to match the .NET version during the code generation process. Therefore, it’s necessary to align the .NET versions of the class library and the application. Simply raising the version of the library might not suffice, especially if it needs to be simultaneously referenced by environments like Unity. However, since multiple target platforms can be specified as shown below, it’s advisable to configure it this way:

<TargetFrameworks>net8.0;netstandard2.1</TargetFrameworks>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants