News for hackers. Stuff that matters.
Re:Comptime – C# meta-programming with compile-time code gen... by eterm on Thursday December 25, 2025 @09:12AM (#46384515)
C# / .NET has always had that abililty.

  <EmbeddedResource Include="/path/to/file.txt" /> 
Then you can read that file from the assembly with:

  assembly.GetManifestResourceStream
I'm not sure what's awkward about that, but it's nothing new.

Discoverability for this is in visual studio, if you go to file properties there's a drop-down where you choose between Content, EmbeddedResource, Ignore, etc.

That determines what happens in compile, whether it is copied to output directory, compiled into the binary, etc.

Re:Comptime – C# meta-programming with compile-time code gen... by andix on Thursday December 25, 2025 @09:20AM (#46384562)
The Stream is awkward. It needs to be processed either once at startup or lazy on access, or every time it's used (allocations!). Also discovering multiple files is awkward.