C
C#5mo ago
юрий

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
Jimmacle
Jimmacle5mo ago
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 close
Lex Li
Lex Li5mo ago
That 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.
Jimmacle
Jimmacle5mo ago
i did it less than a year ago