How to copy a file to output folder without modifications? Visual C#
I would like to publish a project with a mp3 file in the application folder, so that I can use it when app is running. Is there some way to do it?
开发者_运维知识库My current attempt is to click on the mp3 and drag it to the "Solution Explorer". When the program is published, the output folder does have a "play.mp3" file, but it is named "play.mp3.deploy", which turns it unusable
If this is a forms app then add the mp3 file to a resource file (resx) and access it that way.
If the app is a website you should be able to mark the file properties as Build Action = Content and Copy To Output Directory = Copy Always. This should then just get deployed in the same manner a js file would for example.
精彩评论