UWP Deploy Assets from arbitrary path - visual-studio

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"'

Related

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
[]
[]

.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?
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.

Why can't I delete files from my XCode project?

This is probably a very easy question, but I'm having trouble deleting resources from my XCode project. I added them using "Create Folder References for any added folders" so that I could import a whole offline HTML site with its correct folder structure.
Unfortunately, now it has been added like this I don't seem to be able to delete individual files in the structure (it's not available from the Edit menu).
Can anyone help please? Thanks!
That isn't how folder references work. The idea is that its only a reference, you can open files within it and save it from those editors, you can delete or move the entire reference throughout the xcode project, but you can't actually edit it - its read only as far as xcode is concerned. Likewise, you cannot restructure it (move internal files around).
I'm not to sure why apple decided to make this the case, but apparently they have.
If you want to know how one might use the xcode folder system, here's how I tend to use them with my projects:
Whenever I subdivide code into folders, when I drag them into my project I click "recursively create groups for any added folders". If you do this, you any changes you make within xcode will not reflect the actual file itself. As far as I know, there is no way to do this. What does happen then is that when you add a new code file to it, the directory starts off in that file by default. ie, you don't need to navigate to it manually when you create a new file.
I use folder references whenever I'm working with content for an application I'm using. This way, I add all my images, folders, configuration files, whatever - and xcode immediately lists them. The reason I have it within xcode, I can I copy the files into the executables directory by dragging the folder reference into a "Copy Files" build phase.
Thats basically (to my knowledge) how one uses the folder types within xcode - sadly, I don't know how to achieve the functionality you want. You may have to manually delete the folders in finder, which if you do use folder references will update xcode to the change.
I ran into the same issue by using "Create Folder References for any added folders". I wanted to change some of the times but that's not possible. I had added a main folder that had other directories under it. I just had to select the main directory and deleted it and then just add the subdirectories that I needed. You can't make any location or removal changes to the directories that are added this way. -- Jeff
In the project browser, where you're looking at files, right click and choose "Delete". It'll prompt you to either remove the file from the project (leaving the underlying file on the filesystem) or to also move the underlying file to the trash.
I ran into the same issue. Delete the files from the folder directly as opposed to from within Xcode. You'll see the entries turn red under your project. Restarting Xcode should make these red entries vanish.

How to map groups in Xcode the same on the filesystem

I'm kind of at a loss of words for how to properly ask this. Basically instead of Xcode "smart groups", I want the groups to physically translate into directories on the filesystem. How is this done in Xcode 3.1.2?
In Xcode the file structure is a bit of a misnomer, the structure that you are seeing in your Xcode project is a reference mapping of your project not a relational mapping of the structure where your project exists. For example, if you create a group in in the project at the root of the project named 'foo' this creates a reference to a container 'foo' that is managed by the project settings, it does not create a folder named 'foo' in the root directory where your applications exists in the file system. This is a point of contention for many developers using Xcode.
Instead, I would suggest (as #smorgan eluded to) that you create your folder structure in the project folder in the file system (Finder), example, navigate to your project and create folder 'bar'. Then in your project control-click on the project and select ADD > Existing Files... and select the folder. This will import the 'bar' folder into your project - and in fact just creates a reference pointer named 'bar' for said location in your project.
If you are they type of person who likes to have a standard or defined structure for your projects, create a project folder and all of the folders and subfolders that you'd normally have - the project skeleton/tree. This may have Source and Resources at the root and then inside Resources you might have additional folders like Images, Audio, Views, Cells, etc... Your Source folder may have UI, Model, Util, etc... and UI may have Start, Settings, App, etc... Once you have your default project folder defined ZIP the root folder up and name it something like "XCode Project Outline" or something that has meaning to you.
When you have a new project you're about to start, copy the ZIP file to where you want your project to live and simple unZip the file and name the folder the name of the project. Then create the new project file in the folder and then follow the ADD Existing File.../Folders... (recursive = checked) and it will add your entire project folder hiarchy to the project. For a more advance bit of magic; include your common bits of application framework that are not application specific and have those files in your ZIP'd file. Then when you unZip and add the folder hierarchy you'll also be adding your basic files (.h, .m, etc...) as well in one quick and easy fell swoop.
One thing I should mention is that if you start from a project you already have and that project is under version control, you'd be best to "Export" the project from your repository. This will build out all of the files based on the current version in (head) and remove all of the hidden .svn references. You can then prune and modify that folder as you see fit to create your project folder template ZIP file. Good luck and happy coding!
If I'm correctly understanding what you are looking for, the answer is to right-click on the project in the Groups & Files column, select Add > Existing Files..., and then pick the root folder that you want mapped in. In the options sheet that will pop down, change the default "Recursively create groups for any added folders" to "Create Folder References for any added folders".

Set application icon from resources in VS 05

I know I can add a icon to the Resources.resx file of a project and then reference that icon from within the code.
How do I set the icon of the entire EXE from the resources? All I see is a place to browse for another file. I want to use the current icon file that I have in my resources and not have to have a duplicate file in my project...
thanks
The way that the adding of an application icon is that you must select it from the local file system, and then it is embedded into the application at build time. As far as I know it is not possible to have it first pull from a resource file.
One solution I always use to prevent duplicate file references, is to create a solution folder such as "Project Dependencies". And then all refereces are made from that folder, so when building it pulls from the Project Dependencies folder.
This would work for resource files also, just copy them to the solution folder first and then drag them into your resource.
And for the assembly icon, just browse to the Project Dependencies folder as well.
Good Luck!

Resources