.NET MVC3 - Folders Within /Content Folder Missing When Publishing WebSite - asp.net-mvc-3

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?

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.
You might also set the "Copy To Output Directory" setting to True and see what happens.

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.

Related

Is there no way to quickly copy/consolidate all files outside of project folder?

I've been dragging a few assets into my project in Xcode, and while I know you can check that box for 'copy items if needed', that doesn't always show up and so I end up with files that are located in scattered locations on my hard drive. I know I could manually put the files in the project folder, but is there no way to automatically copy external files to an internal location?

UWP Deploy Assets from arbitrary path

I want to avoid duplicating 400+ files in the Assets folder of my UWP App project folder. I want to tell VS to take files from an arbitrary location in my source tree, and use those in the Assets folder, preserving folder structure etc for deployment. I don't even mind setting the pathing manually in the project file properties if I must.
Is there a way to do this? The best I got was to right click on Assets\BlahFilter -> Add -> Existing Item. This results in the file appearing in the Solution treeview in the place I expect, but when deploying, the file appears in the root of AppX folder, ignoring any subfolder (filter) structure specified above.
I fixed this. You can use a "Custom Build Step" and treat the output as content. This will result in VS packaging that output directory's contents in the final AppX package. You can specify a folder, and all sub-folders will be automatically copied. The build command can be blank, or something innocuous like 'echo "blah"'

Copying assets into UWP application package

I have a large folder structure with a ton of subfolders that I am using for application data in my UWP app. When testing, I can just have it sitting on disk and it's fine, but when I make a store package, I need to be able to copy that data in. The only way I've found to include assets is to manually add individual files into Visual Studio and set them to be "Content". Is there a way to copy in an entire folder as "Content" and preserve its folder structure?
You don't have to manually add all the files. Add the entire folder inside the UWP app folder. Once you do that you should be able to use the Show All Files option in the solution explorer and add the entire folder. If the property of the added files is not already set to "Content", multi select the files and set the Build Action property in the Properties window to Content
[]
[]

Adding a folder to Xcode project

I have a folder full of files on my iPhone app which I want to use, but Xcode will not let me add folders to the bundle, only its files. I can't do this because I want it to be a bit more convenient, so I can reference the folder in my code. So, how do I do this? The compile settings in the build targets won't let me add the folder, only its files.
Drag the source folder to the project "Groups & Files" area, say under the Resources group. In the dialog select "Create Folder References for any added folders". This will create a blue folder and the folder will and it's inter hierarchy will appear in the apps resources. This will automatically create an entry in "Copy Bundle Resources" build phase This is commonly done for image & help files. Any changes made to the folder will also change the files included by Xcode.
Note the important thing here: the folder must be a Folder Reference (blue folder). If it's a group (yellow folder), delete it and all its contents from your project tree, then re-add as a Folder Reference. Then make sure that's in the Copy Bundle Resources build phase. – cdespinosa

On add existing item in VS2010, why can't I "add as link" a file from the same project?

I have two folders in my library project, folder A and folder B. Folder A will contain all the real files, but Folder B (and a bunch of other folders) need to contain links to the folder A files.
I tried going Add existing item (go to folder A)-> add (down arrow) -> add as link but the add existing item dialog window just closes and nothing happens. It seems I can add links to files outside the library project though. What's going on here?
-Isaac
For some reason Visual Studio seems to silently ignore possible problems with adding file as a link. I just had the same problem and the solution was to:
Check if project folder already contains a file with the name of file being linked, if so delete or rename this resource.
Visual Studio 2010 seems to cache project directory contents, as (1) was not enough to successfully link the file. Restarting VS helps.
Sound like Visual Studio is crashing for some reason. I just tested this in project that has many folders. I had an images folder and I was able to add as link and image to another folder, so it seems it is possible.
It does add the file to the project but does so to the original location, not the new location.
You can see this if you exclude the original file from your VS project (but don't delete the file from disk) - the file will then get add to your project in it's original location
e.g. if you have folder FolderA\index.htm and FolderB, and you want to create a link to index.htm in FolderB. Exclude index.htm from your project (but leave it in FolderA on the disk) so your project just has two empty folders. Right-click on FolderB and click Add Existing Item, select index.htm from FolderA and click Add as Link. The file will be added to your project but under FolderA (where it resides on disk) not within FolderB which is where you told it to add it.
So looks like a VS bug to me.
As has been mentioned, this is a valid scenario if you have multiple "root" websites within one project but you want to share resources between them
In my case (using Visual Studio 2013) I just had to show all files (button on the top of the Solution Explorer), right click on each file/folder and click on "Include on Project".

Resources