I've been looking for any way to set the CopyToOutput attribute to true for content files I'm including in a NuGet package built in VS2017 from a .NET Standard Library project.
When adding the files using the Content node, I can see the files in the package, but when looking at the nuspec that is pulled out when it's cached locally, there is no CopyToOutput, so it's false by default. In this case, when it's referenced in an ASP.NET Core site, nothing is copied into the application. If I manually update that cached version to include the attribute and set it to true and restore, everything gets copied.
Unfortunately, I looked into the Nuget.Build.Tasks.Pack.dll and it looks like there's no way to pass that value through an MSBuild property.
Did anybody run into this issue and has a workaround?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…