0

I've got an application that has hundreds of plugins available as Nuget packages in a private repo. The application's "Plugin Search" feature relies (in part) on embedding some metadata about each plugin's respective features in the package's <Tags> field.

My goal is to automatically populate each package's <Tags> at build time, based on reflecting over the types defined in the package's project.

Has anyone accomplished this trick of programmatically editing the nuget package properties?

I'm using sdk-style projects, dotnet 8, vs2022

4
  • This doesn't seem to have nothing to do with Roslyn. What have you tried and how did it fail? Commented Sep 2, 2024 at 17:47
  • @PauloMorgado I suspect one possible approach may be to use a roslyn analyzer with code fix to edit the '<Tags>' property in the .csproj but I don't know enough about that toolset to know if it's viable. I've been successful in extracting the metadata I need via reflection (by passing the compiled dll to an executable AfterBuild), but i've not found a good way to pass this metadata to the dotnet pack stage Commented Sep 2, 2024 at 18:51
  • I don't think Roslyn analizers can do that. You'd need a Visual Studio extension for that. Commented Sep 3, 2024 at 8:09
  • 1
    You can create a MSBuild task for that. Commented Sep 3, 2024 at 8:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.