【发布时间】:2018-03-27 07:50:08
【问题描述】:
基于这个问题:Prevent duplicating files in NuGet content and contentFiles folders,我正在使用我的 NuGet 包的build/Project.targets 文件将一些文件添加到项目构建输出中。喜欢:
<?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>
现在,我实际上希望这些文件在 Solution Explorer 中可见,以便开发人员可以调整项目属性。但是将<Visible> 标签设置为true 无效。这甚至可能吗?
即使采用完全不同的方法,仍然允许 NuGet 包将文件添加到 packages.config 和 PackageReference 格式的项目构建输出,我也会很高兴,但在解决方案资源管理器中显示文件 em>。
【问题讨论】:
标签: visual-studio nuget nuget-package