通过 FTP 发布网站时未拾取 ItemGroup
在我的 MSBuild 中,我创建了一个项目组,如下所示:
<ItemGroup>
<SomeFileType Include="dir/file1.ext" />
<SomeFileType Include="dir/file2.ext" />
<SomeFileType Include="dir/file3.ext" />
</ItemGroup>
然后我尝试通过 FTP 发布网站。除非我将“SomeFileType”更改为“Content”,否则不会拾取上面的此项目组。
我想使用自定义名称的原因是,稍后在构建文件中我需要使用 @(SomeFileType) 引用此文件集合。
您是否有任何想法来完成上传文件并能够引用这组项目?
谢谢!
PS 我还尝试添加以下内容以确保可以拾取所有文件。
<Content Include="dir/*.ext" />
但这个解决方案并不理想。首先,它涵盖了所有文件。其次,在我的解决方案资源管理器中,某些文件显示两次。
In my MSBuild, I created an item group, like the following:
<ItemGroup>
<SomeFileType Include="dir/file1.ext" />
<SomeFileType Include="dir/file2.ext" />
<SomeFileType Include="dir/file3.ext" />
</ItemGroup>
Then I try to publish the website via FTP. This item group above doesn't get picked up unless I change "SomeFileType" to "Content".
The reason why I want to use a custom name is that later in the build file I need to reference this collection of files using @(SomeFileType).
Do you have any idea to accomplish both uploading the files and being able to reference this group of items?
Thanks!
P.S. I also tried to add the following to make sure all the files can be picked up.
<Content Include="dir/*.ext" />
But this solution is not ideal. First, it covers all the files. Second, in my solution explorer, some files show up twice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您尝试这样做,会发生什么:
您仍然可以单独引用它们,并且不使用通配符。
尝试此操作,看看是否可以防止文件出现两次。
What happens if you try instead:
You get to still refer to them separately, and you aren't using a wildcard.
Try this to see if it prevents the files from showing up twice.