0

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

Satbir Kira
  • 792
  • 6
  • 21
  • What do you mean by latest build? Do you mean it's published code. – Rahul Nikate Jun 09 '15 at 09:40
  • Just change the build action. – Ashley Medway Jun 09 '15 at 09:41
  • Expand the resources folder. Are there any files in there _in your project_? What is their build action? When there are no files that must be copied to the output directory, the build will not create the empty target folder. See [How to force MSBuild to copy empty folders in project?](http://stackoverflow.com/questions/13025754/how-to-force-msbuild-to-copy-empty-folders-in-project). – CodeCaster Jun 09 '15 at 09:44
  • @CodeCaster Presence of Expand arrow = Files are there in folder – Rahul Nikate Jun 09 '15 at 09:48
  • @Rahul not always, not in every Visual Studio (or am I thinking of SQL Server Management Studio?). Still my point stands: if there are no files in there, or no _included_ files, or no files that need to be copied to output, the empty folder will not be created. OP's question is unclear; lacks information. – CodeCaster Jun 09 '15 at 09:49
  • @CodeCaster Agree with you. – Rahul Nikate Jun 09 '15 at 09:53

3 Answers3

3

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.

Community
  • 1
  • 1
Ashley Medway
  • 7,151
  • 7
  • 49
  • 71
  • 1
    I had to click the show all files button below the "Solution Explorer" text to see that I wasn't including anything. – Satbir Kira Jun 10 '15 at 13:47
1

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

Rahul Nikate
  • 6,192
  • 5
  • 42
  • 54
-2

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

Satbir Kira
  • 792
  • 6
  • 21
  • 1
    You're question was clearly about missing files in build and not visual studio. This answers the question of missing files in visual studio but not in build. If you're question was really about missing files in visual studio then it is very poorly worded, shows lack of research and is a duplicate. – Ashley Medway Nov 25 '15 at 18:11
  • @AshleyMedway You take yourself way to seriously. I posted a question, none of the answers did the trick. I was new to visual studio, and from the view count you can bet so were other people. This is not a stupid question. Go be rude somewhere else. – Satbir Kira Nov 27 '15 at 08:10
  • 1
    @AshleyMedway wasn't being rude, just pointing out that you could have done more research as this question has been answered elsewhere. – Mike Devenney Apr 21 '16 at 15:50