xiecs
xiecs

Reputation: 727

.NET MVC3 - Folders Within /Content Folder Missing When Publishing WebSite

I have a folder in my /Content folder which is not being included when I build and publish my website. Only the standard CSS, Images, Scripts and themes folders have been included. I also have a Downloads folder containing .doc files that has not been included.

Am I limited to the standard set at the level below /Content?

Upvotes: 2

Views: 4458

Answers (2)

3Dave
3Dave

Reputation: 29041

Empty folders typically don't get deployed.

For the Downloads folder, what's the "Build Action" set to for the items that it contains? They should be set to "Content" for anything that you want deployed. This isn't automatically set for some file types, such as PDF, etc.

The only items that get deployed have to be both referenced in the project (that is, they have to appear in the solution explorer, not just present in the folder on disk) , and have the correct build action set.

enter image description here

You might also set the "Copy To Output Directory" setting to True and see what happens.

Upvotes: 7

Ofer Zelig
Ofer Zelig

Reputation: 17470

In Visual Studio, right click on every folder underneath /Content folder, and choose Include In Project. Else, the files are only physically there on disk but the project doesn't know they are there and doesn't publish them.

Upvotes: 4

Related Questions