EnumFastToStringDotNet icon indicating copy to clipboard operation
EnumFastToStringDotNet copied to clipboard

Create Nuget Package

Open Spinnernicholas opened this issue 3 years ago • 2 comments

I want to publish a Nuget package to make using this generator as easy as possible. The only problem is no one seems to agree on how to configure the project so that the generator gets loaded correctly. I have tried several methods including using the analyzer template and trying a handful of templates/tutorials from GitHub. Nothing has worked for me.

Also, I want the Nuget package to be a different project from the main project.

Spinnernicholas avatar Aug 31 '21 05:08 Spinnernicholas

It's actually not that hard. Here's how we did it in https://github.com/jitbit/MapDataReader/

Check out this file, near the end, how it makes sure it's a source generator package: https://github.com/jitbit/MapDataReader/blob/main/MapDataReader/MapDataReader.csproj

Also, you need to target net standard 2.0 I believe

alex-jitbit avatar Oct 26 '22 22:10 alex-jitbit

@alex-jitbit Thanks! That's what I was having trouble figuring out.

Spinnernicholas avatar Oct 27 '22 14:10 Spinnernicholas