-1

I want to include files from the solution directory, regardless of where the files are. I added this to my .csproj file:

  <ItemGroup>
    <Content Include="$(SolutionDir)\web\**\*" />
  </ItemGroup>

But the files do not appear in the solution explorer. And they do not appear in the publish output either.

How to do this correctly?

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
  • How about this issue now? I could see the files in the solution explorer with your code snippet. What is your project type? And Have you double check if there is any files that exist under the Web folder and if the path is correct. – Leo Liu Oct 04 '17 at 06:58

1 Answers1

1

You still need to tell MSBuild to copy the content, for example

<ItemGroup>
  <Content Include="$(SolutionDir)\web\**\*">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </Content>
</ItemGroup>
stijn
  • 34,664
  • 13
  • 111
  • 163