0

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.

stivlo
  • 83,644
  • 31
  • 142
  • 199
Grace Huang
  • 5,355
  • 5
  • 30
  • 52

1 Answers1

1

What happens if you try instead:

<Content Include="@(SomeFileType)" />

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.

<Content Include="@(SomeFileType)">
   <Visible>false</Visible>
</Content>
Brian Kretzler
  • 9,748
  • 1
  • 31
  • 28
  • Thank you! Appreciate your help! I tried this as well. Unfortunately it still causes the files to show up twice. – Grace Huang Mar 30 '11 at 13:30