RudolfKurkaMs / StructPacker

Low-level, lightweight and performance-focused serializer for C# struct types that uses Source Generators technology.
MIT License
75 stars 7 forks source link

'StructPacker' Namespace Error #3

Open mattluard opened 4 months ago

mattluard commented 4 months ago

Hi!

I wanted to give StructPacker a spin inside of a Unity project, it looks like a neat utility and very suitable for video games given the speedy benchmarks described in the Readme.

After importing the project in NuGet, there were a whole series of errors about not finding Microsoft.CodeAnalysis.CSharp. I used NuGet to install that package too, and was left with one remaining error:

RudolfKurka.StructPacker\RudolfKurka.StructPacker.StructPackerGenerator\structpacker_extensions.cs(1,7): error CS0246:
The type or namespace name 'StructPacker' could not be found (are you missing a using directive or an assembly reference?)

On the plus side, it seems like I can import StructPacker in my scripts, add [Pack] to a struct definition and call PackToBuffer without syntax errors, so the Code Generation looks to be working.

Looking at the C# files in the repo, I see some are using the StructPacker namespace, while others are using the RudolfKurka.StructPacker namespace - is that the source of the error here?

And also with regards to Microsoft.CodeAnalysis.CSharp, is the StructPacker NuGet package missing a dependency there?