0

In my current project I have a folder with several files that the application needs to function properly. The folder is in the bin/debug folder and with the line Application.StartupPath I can easily access the files. It couldn't be easier.

However, when I publish the application the files don't seem to be included in the project, at least not at the StartupPath.

So my question is: how am I supposed to add this folder to my published application?

Scott Weldon
  • 9,673
  • 6
  • 48
  • 67

1 Answers1

1

First, you'll need to include those files in your project. Then click each file in the Solution Explorer and in the Properties Windows change the value for "Copy to Output Directory" to "Copy Always".

NoAlias
  • 9,218
  • 2
  • 27
  • 46
  • 1
    Another option you can explore is Post Build Events: http://stackoverflow.com/questions/11001822/copy-files-from-one-project-to-another-using-post-build-event-vs2010 – NoAlias Oct 03 '16 at 21:28
  • Thanks for the help! I've followed your steps and it works for .vb files, but folders and .png files don't have the 'Copy to output directory' property. Am I missing something? – Jan met de korte Achternaam Oct 03 '16 at 21:56
  • Never mind, I've figured it out by myself, there's a 'resources' tab at project properties where they can be added. – Jan met de korte Achternaam Oct 03 '16 at 22:12