I\'m trying to build a NuGet package that adds our company\'s code analysis dictionary automatically and updatable.
The rule set is added in the content folder and n
There's no need to script this. Both the ruleset and dictionary can be registered via an imported MSBuild .props file, as described here https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package#include-msbuild-props-and-targets-in-a-package
For example, your NuGet source folder structure might look like this (assuming "CodeAnalysisSettings" is your package ID):
where the contents of CodeAnalysisSettings.props are something like the following:
true
MyRules.ruleset