VisualStudio WPF. Adding a folder into output directory - wpf

I need to create a Folder with Wallpapers. This needs to be placed into the output directory so that users can then add their own images.
So my question is:
How can i place a folder in my output directory? (this should work in debug and release)
For the second part of the question I can handle on my own, which would be to bring all the items in that folder and present it to the user to chose.

Setting items in the folder in your project (assuming you have some default wallpapers) to Build Action = Content, Copy to Output Directory = Copy Always/Copy if Newer will place them inside that same folder structure in your output directory. If you don't already have files there you could add something like a ReadMe.txt with instructions on adding images that could serve the same purpose.

Add a folder to your project and then set its Copy To Output Directory property appropriately.

Related

Logic Apps returns Error 404 for Get File Content while Looping in Sharepoint's parent folder

when I run Get File Content for the parent folder it retuns the following error
If I'm doing this for the last folder placed in this parent folder it is OK.
Not working:
Working:
Could you help me?
Get file Content works only for file types but not folders and List Folder gives what all the folders that are present in the path but not the files in the nested folders. If you are trying to get the list of all files in all the folders in your share point then instead of using List Folder, you can use Get files (properties only) as it lists all the folders and files present in the path and looping through its "value" filtering "Is folder" gives us desired results. Is Folder checks if it's a 3file or a folder. Here is my logic app which filters all the files in the sharepoint using Condition connector and Is Folder property.

Publish files to bin folder when source files are in a sub-folder with ClickOnce with WPF app

I have found numerous articles on StackOverflow and elsewhere stating that if you wanted to output your files to the bin folder using ClickOnce, you should set the
BuildAction: Content
CopyToOuputDirectory : Copy if newer
but some of my binaries are located in a Dependencies subfolder located in the root of my project and when I publish the content, they are being outputted to
<wpf app folder>\dependencies instead of being in the <wpf app folder> causing my app to not function properly.
Any suggestions on how I can change this to force ClickOnce to output specific files to <wpf app folder>\ irrespective of where the Source files are located.
I eventually found a work-around which I don't like but I need to move on. To circumvent this problem I added the required libraries to the root of my project as links and still set the BuildAction to Content and CopyToOutputDirectory to Copy if newer.
I thought I'd explain it with an example as it may make a bit more sense.
Project Path: C:\Work\MyApp and it contains the following sub-folders:
D:\Work\MyApp\MyApp.csproj
D:\Work\MyApp\MyApp.xaml
...
D:\Work\MyApp\Bin\Debug
D:\Work\MyApp\Bin\Release
D:\Work\MyApp\Bin\Release\MyApp.exe
D:\Work\MyApp\Depedencies\LibA.dll
D:\Work\MyApp\Depedencies\LibB.dll
etc...
The libraries are third-party tools and are actually contained in their own folder:
D:\Tools\MyThirdPartyLib\Distributation\LibA.dll
D:\Tools\MyThirdPartyLib\Distributation\LibB.dll
By having the libraries in D:\Work\MyApp\Dependencies did not work as ClickOnce would install the app in:
C:\Users\\AppData\Local\Apps\2.0...\MyApp.exe
and it installed the files located in the Dependencies sub-folder in:
C:\Users\\AppData\Local\Apps\2.0...\Dependencies\LibA.dll
C:\Users\\AppData\Local\Apps\2.0...\Dependencies\LibB.dll
Which caused my app not to work.
To get around it, I ended up adding LibA.dll and LibB.dll to the root of my project as "Linked files" and set their BuildAction and CopyToOutputDirectory but not by pointing the linked files to
D:\Work\MyApp\Depedencies\LibA.dll
D:\Work\MyApp\Depedencies\LibB.dll
but instead pointing them:
D:\Tools\MyThirdPartyLib\Distributation\LibA.dll
D:\Tools\MyThirdPartyLib\Distributation\LibB.dll
And this seems to have done the trick. My only beef about it is that now I've got 10 odd files listed in the root of my project in visual studio which I don't like:
MyApp Solution
- MyApp Project
- MyApp.csproj
- MyApp.xaml
- ...
- LibA.dll
- LibB.dll
- ...
But it will have to do for now.
Hope it helps others!

Cocos2D: kazmath/kazmath.h file not found

I am upgrading Cocos2D 0.99.5 to version 2. I was hoping the other Stack Overflow questions about this would help me but they have not.
Right now I have the kazmath folder inside my project folder. It's the kazmath folder inside the include folder.
I get the errors "kazmath/kazmath.h file not found" and "kazmath/mat4.h file not found"
In my header search paths I've tried various things including "${SRCROOT}/kazmath" recursive and non recursive.
I don't know if it matters, but in my project navigator, the folders look like this:
Cocos2D was already looking for the folder "kazmath". I stuck the kazmath and cocos2d folders into a libs folder on my project navigator and made the search path "${SRCROOT}/libs"

How to prevent Joomla site creating unwanted folder

I have a menu link with the alias "inside" on a joomla 3.1.5 site here: http://naiwellness.com
Every morning I check the site and a folder named "inside" has been created in the root dir which prevents the site from loading as it should, instead displaying a directory contents listing at http://naiwellness.com/inside
Anyone have any ideas how to prevent this please?
Thanks
This is just a theory, but check the xml files of your installed modules and plugins (most likely a plugin) for this line...
<folder>inside</folder>
and if it exists try deleting that line of code - or better still uninstall the extension - that should fix it. It's possible that a plugin requires that folder and has php code to create the folder if it doesn't exist - and so creates the folder each time it is run - i.e. when the site is loaded. The above line of xml code I have asked you to look for will go someway to helping determine if this is the case.

Preserving Header Directory Structure in Xcode for Static Library

I'm developing a static library in C++ using Xcode. I have an Installation Directory set where it copies all of my public header files, but when I compile it just copies all the headers into one directory. Is there a way to tell Xcode to preserve the directory structure of my header files? Thanks in advance!
I also needed to preserve the header file directory structure for a C++ library project and I finally managed to do it. It is ridiculously complicated with XCode, compared to the simple nature of the task. The key is to create "folder references" at first, then to copy the header folders in an extra build phase and afterwards to delete .c/.cpp-files from these exported header folders with a script, because XCode will not only copy the .h-files.
I've written a blog post here on how to all achieve that, because it's more tricky in detail. You might also want to check out an example XCode project that I've pot on github.
When you add files to your project, you have to choose next parameter on an additional window "Create folder references for any added folders". And then all your files will have fixed path for your files and will save structure after compilation.

Resources