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

Install the MemoryPack.Unity package by referencing the git URL An error has been reported #358

Open
ZZQzero opened this issue Jan 2, 2025 · 8 comments

Comments

@ZZQzero
Copy link

ZZQzero commented Jan 2, 2025

Install the MemoryPack.Unity package by referencing the git URL
https://github.com/Cysharp/MemoryPack.git?path=src/MemoryPack.Unity/Assets/MemoryPack.Unity
image

@neuecc
Copy link
Member

neuecc commented Jan 6, 2025

PreserveAttribute is exists in Core.
Have you referenced the Core library?
https://github.com/Cysharp/MemoryPack/blob/ca28202a65b22b6fd3ea66b4c75eab252255a097/src/MemoryPack.Core/Internal/PreserveAttribute.cs

@ZZQzero
Copy link
Author

ZZQzero commented Jan 7, 2025

Thank you for your reply.

Because I'm using the latest version MemoryPack, Unity doesn't support C# advanced syntax

@neuecc
Copy link
Member

neuecc commented Jan 8, 2025

So you're saying you haven't installed it?
As written in the Installation Section, both installations are required.
https://github.com/Cysharp/MemoryPack?tab=readme-ov-file#unity

@carrascodev
Copy link

this is happening with MessagePack too, I guess because Core/Shims etc doesn't have a package.json nor the package.json in MemoryPack.Unity includes the dependencies.

@neuecc
Copy link
Member

neuecc commented Jan 30, 2025

Oh, I see, I'll take a look at the dependency.

@neuecc
Copy link
Member

neuecc commented Jan 31, 2025

asmdef references MemoryPack.Core in precompiledRefern
https://github.com/Cysharp/MemoryPack/blob/main/src/MemoryPack.Unity/Assets/MemoryPack.Unity/Runtime/MemoryPack.Unity.asmdef#L9-L11
The dependencies in package.json are dependencies within upm, so NuGet is outside of that and should not be relevant.

@carrascodev
Copy link

Yes but in order for that to work you need to have the DLL included on UPM source somehow, I suggest making a package.json for core module, and further dependencies because of that. But honestly using nuget for unity is good enough for fixing this. Just decided to comment because installs via UPM only won't work.

@neuecc
Copy link
Member

neuecc commented Feb 3, 2025

In the end, is it okay to say that the error is occurring because you are not following the instructions, even though NuGetForUnity says to add the dll first?
If that's the case, I'm going to close it.

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

3 participants