Copy file on NuGet restore / install
As far as I know this is not possible, but still worth asking to be sure. Is it possible to copy a file (e.g. an .editorconfig) on NuGet restore or install?
I was trying to share an .editorconfig file using a NuGet package, but what I found is that it only works when building the project.
3 Replies
you can add a
.props
file that adds additional targets to the project the package is added to, and that target could copy files
it's not on install, but it's closeThat was once supported when you can add PowerShell script in your NuGet package to execute actions, but deprecated for good reasons (security for example). So now just impossible during NuGet restore or install.
i did it less than a year ago