我的项目文件夹中的 \lib 文件夹中有几个 dll 文件。在 dll 的属性页中,我已选择 "Build Action" 为 "Content" 并将 "Copy to Output Directory" 设置为 "Copy always"。
构建后,我确实得到了复制的 dll,但它们在 \bin\Release\lib 中而不是在 \bin\Release 中。
是否有一种方法可以将 dll 文件复制到 \bin\Release(而不是 \bin\Release\lib)而不编写后生成脚本或使用 nant 等工具呢?
ContentWithTargetPath
дјҡз ҙеқҸеўһйҮҸзј–иҜ‘пјҲеңЁVS 2017 15.9.9дёҠжөӢиҜ•иҝҮпјүгҖӮ - Mads Ravn<ItemGroup> <ContentWithTargetPath Include="lib\**"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <TargetPath>%(Filename)%(Extension)</TargetPath> </ContentWithTargetPath> </ItemGroup>
- Robin Güldenpfennig