Based on this question: Prevent duplicating files in NuGet content and contentFiles folders, I'm using build/Project.targets
file of my NuGet package to add some files to project build output. Like:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)..\tools\test.jpg">
<Link>test.jpg</Link>
<Visible>false</Visible>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
</Project>
Now, I actually want those files to be visible in Solution Explorer, so that developer can tweak item properties. But setting the <Visible>
tag to true
makes no effect. Is this even possible?
I'd be happy even with a completely different approach that still allows the NuGet package to add files to project build output for both packages.config
and PackageReference
formats, yet show the files in Solution Explorer.