1

My web application has a node process that runs things like transpilation and minification, and produces a bunch of output files. We've had problems with our CI server not sending these auto-generated files out unless they were manually included in the project.

Manually including auto-generated files is a pain, is easy to forget, and just an all-around bad idea.

How can I get visual studio to just include everything under a specific folder, no matter what. I just need these files to exist to my script loader can load them when needed.

Per this answer I tried

  <Target Name="BeforeBuild">
    <ItemGroup>
        <Content Include="2\application-base\**\*.js" />
    </ItemGroup>
  </Target>

to no avail. After adding that I've tried building the solution, the project, re-building the project, none of which cause anything in that folder to show up in the solution explorer as included.

Community
  • 1
  • 1
Adam Rackis
  • 82,527
  • 56
  • 270
  • 393
  • `\2\...` refers to a root directory on the drive, not the project. Try `2\...` (will make answer if it works, cant see anything else wrong) – leppie Apr 18 '16 at 19:01
  • @leppie - I tried it without the least `\` originally - that did nothing, so I tried the leading slash, which also did nothing – Adam Rackis Apr 18 '16 at 19:03
  • Just for kicks, do `**\2\...` it might be the directory is not in the root of the project/solution, and that should find it. – leppie Apr 18 '16 at 19:06
  • @leppie I tried `` which also did nothing :( – Adam Rackis Apr 18 '16 at 19:09
  • And it you just put `Content ` in the main `ItemGroup` of the project? Any effect? – leppie Apr 18 '16 at 19:13
  • @leppie - huh, `` in the main `` worked just great - I thought I had read that doing that would auto-expand the `` item to manually include every file there, so it would only work the first time. Is that not the case? – Adam Rackis Apr 18 '16 at 19:24
  • It would appear in the project then, but from the link, the `Visible` subitem should hide them if you dont want them to be shown. I dont really know about the `BeforeBuild` target, maybe not even being called (test with `Message` item in there if you want to hack further). – leppie Apr 18 '16 at 19:44
  • @leppie well in any even, your comment two up from here is the answer - can you post that please so I can accept and upvote it? – Adam Rackis Apr 18 '16 at 19:50

1 Answers1

1

Just put Content in the main ItemGroup of the project.

Ie

<ItemGroup>
    <Content Include="2\application-base\**\*" />
Adam Rackis
  • 82,527
  • 56
  • 270
  • 393
leppie
  • 115,091
  • 17
  • 196
  • 297