Visual Studio 2015 Ignoring New Folders & Files

2.3k Views Asked by At

When I add a folder to the visual studio project, it ignores it completely. It didn't do that until recently, and I am not entirely sure why this is. A clean build does not solve the problem, in the visual studio folder structure, the resources folder is present. enter image description here

enter image description here

And in the latest build it is completely ignored.

enter image description here

To show it is not exuded from the project: enter image description here

3

There are 3 best solutions below

3
On BEST ANSWER

I had to click the show all files button below the "Solution Explorer" text to see that I wasn't including anything.

0
On

In the Visual Studio Solution Explorer right-click on on each files under resources folder and select Properties > set build action to content.

1
On

If the files are missing on a build server check the files are committed to your source control.

If the folder is empty, its not clear in your question if it is or not, you can either add a dummy.txt file or follow the instructions listed here. How to force MSBuild to copy empty folders in project?

If the files are missing from a publish you need to select all the files you want to publish, and change the "Build Action" to Content.

You cannot directly select a folder, you need to select the individual files.

Interesting post about the different options for build action:
What are the various "Build action" settings in Visual Studio project properties and what do they do?

Files

Side Note
If you want your files to be published to the output direct on build. I.E. the bin folder. Then set the "Copy to Output Directory" to copy always or copy if newer.
Not sure why you would want to do this for css files though.