I have some files, sound files (.wav and .mp3) and text files (.rtf), in my bin\Debug folder during coding, but after publishing they are nowhere to be found.
My application can play sound files and these are the default sound files that are supposed to be installed with the application in the Application.Startup path.
The text *.rtf files I load into a RichtextBox control in my Help form for the application.
I have their properties set to Content and Copy if Newer.
You need to set these files as content (as you have) so that they get copied to the bin folder. Then open up the project properties page, select the "Publish" Tab and click "Application Files...". You should now see a list of files related to your project and value indicating how they should be published. More than likely your files have been marked as data and would be destined for your ClickOnce applications data folder not the bin folder. Either change your code to use the ClickOnce data folder (there are helper methods) or make sure that "Include" is selected and not "Data File".
Alternatively if the files are never expected to change on the client application you could consider embedding your files into your dll as a resource.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With